/* =========================================================
   AIエージェント研修 受講者サイト  共通スタイル
   Claude風：クリーム × テラコッタ × オリーブ
   ========================================================= */
:root {
  --c-primary: #c96442;
  --c-primary-dark: #a8502f;
  --c-mint: #788c5d;
  --c-mint-light: #eef0e6;
  --c-sky-light: #f6ebe4;
  --c-bg: #faf9f5;
  --c-surface: #ffffff;
  --c-text: #1f1e1d;
  --c-sub: #5e5d59;
  --c-line: #e8e6dc;
  --c-warn: #b8742a;
  --c-warn-light: #f8efe2;
  --grad: linear-gradient(135deg, #d97757 0%, #c15f3c 100%);
  --radius: 16px;
  --shadow: 0 4px 20px rgba(60, 45, 30, 0.08);
  --shadow-hover: 0 10px 30px rgba(60, 45, 30, 0.15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.4; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
code, pre { font-family: "Consolas", "Menlo", monospace; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--c-text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800;
}
.logo small { display: block; font-size: 11px; color: var(--c-sub); font-weight: 500; line-height: 1.2; }
.logo span { line-height: 1.2; }
.nav-wrap { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: 10px; color: var(--c-sub);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--c-sky-light); color: var(--c-primary); text-decoration: none; }
.nav a.active { background: var(--c-sky-light); color: var(--c-primary); font-weight: 700; }
.nav a.nav-help { color: var(--c-warn); }
.nav a.nav-help:hover, .nav a.nav-help.active { background: var(--c-warn-light); color: var(--c-warn); }
.user-box { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-box .industry-chip { background: var(--c-mint-light); color: #5f7048; padding: 2px 10px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.user-box > * { white-space: nowrap; }
@media (max-width: 1440px) and (min-width: 1201px) { .user-box .user-name { display: none; } .nav a { padding: 8px 9px; } }
.btn-logout { background: none; border: 1px solid var(--c-line); border-radius: 8px; padding: 4px 10px; cursor: pointer; color: var(--c-sub); font-size: 12px; font-family: inherit; }
.btn-logout:hover { border-color: var(--c-primary); color: var(--c-primary); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--c-text); }

@media (max-width: 1200px) {
  .menu-toggle { display: block; }
  .nav-wrap { display: none; }
  .site-header.open .nav-wrap {
    display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; padding: 12px 16px 16px; border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow);
  }
  .site-header.open .nav { flex-direction: column; }
  .site-header.open .user-box { padding: 8px 12px 0; border-top: 1px solid var(--c-line); }
}

/* ---------- レイアウト ---------- */
main { min-height: calc(100vh - 64px - 120px); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.page-head {
  background: var(--grad); color: #fff; padding: 48px 0 56px; position: relative; overflow: hidden;
}
.page-head::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px;
  border-radius: 50%; background: rgba(255,255,255,.12);
}
.page-head .eyebrow { font-size: 13px; letter-spacing: .15em; opacity: .9; font-weight: 700; }
.page-head h1 { font-size: clamp(26px, 4vw, 36px); margin: 6px 0 8px; }
.page-head p { margin: 0; opacity: .95; max-width: 720px; }
.breadcrumb { font-size: 12px; opacity: .85; margin-bottom: 8px; }
.breadcrumb a { color: #fff; }

.section-title { font-size: 24px; display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.section-title::before { content: ""; width: 6px; height: 26px; border-radius: 3px; background: var(--grad); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; border: 1px solid var(--c-line);
}
.card-link { display: block; color: inherit; transition: transform .2s, box-shadow .2s; }
.card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); text-decoration: none; }
.card h3 { font-size: 18px; }
.card .icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; background: var(--c-sky-light); margin-bottom: 14px;
}
.card .muted { color: var(--c-sub); font-size: 14px; margin: 0; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700; transition: .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(201,100,66,.3); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(201,100,66,.4); }
.btn-white { background: #fff; color: var(--c-primary); }
.btn-outline { background: #fff; color: var(--c-primary); border: 2px solid var(--c-primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- バッジ・タグ ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.badge-blue { background: var(--c-sky-light); color: var(--c-primary); }
.badge-mint { background: var(--c-mint-light); color: #5f7048; }
.badge-orange { background: var(--c-warn-light); color: var(--c-warn); }
.badge-gray { background: #f0eee6; color: var(--c-sub); }

/* ---------- ログイン ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-visual {
  background: var(--grad); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-visual::before, .login-visual::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1);
}
.login-visual::before { width: 420px; height: 420px; right: -140px; bottom: -140px; }
.login-visual::after { width: 200px; height: 200px; left: -60px; top: -60px; }
.login-visual h1 { font-size: clamp(28px, 3.4vw, 42px); position: relative; }
.login-visual p { font-size: 17px; opacity: .95; position: relative; }
.login-steps { list-style: none; padding: 0; margin: 28px 0 0; position: relative; display: grid; gap: 12px; }
.login-steps li { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.15); padding: 12px 16px; border-radius: 12px; }
.login-steps b { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--c-primary); display: grid; place-items: center; font-size: 14px; flex-shrink: 0; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: #fff; }
.login-form { width: 100%; max-width: 400px; }
.login-form h2 { font-size: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 13px 16px; border: 2px solid var(--c-line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: var(--c-bg); transition: .2s;
}
.form-control:focus { outline: none; border-color: var(--c-primary); background: #fff; }
.form-error { color: #e53935; font-size: 14px; min-height: 1.5em; margin-bottom: 8px; }
.demo-box { margin-top: 24px; background: var(--c-sky-light); border-radius: 12px; padding: 14px 16px; font-size: 13px; color: var(--c-sub); }
.demo-box table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.demo-box td { padding: 3px 4px; }
.demo-box code { background: #fff; padding: 1px 6px; border-radius: 4px; color: var(--c-text); }
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { padding: 40px 24px; }
  .login-steps { display: none; }
}

/* ---------- トップページ ---------- */
.hero { background: var(--grad); color: #fff; padding: 56px 0 72px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; width: 480px; height: 480px; right: -120px; top: -160px; border-radius: 50%; background: rgba(255,255,255,.1); }
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(28px, 4.2vw, 44px); margin-bottom: 14px; }
.hero h1 em { font-style: normal; background: rgba(255,255,255,.22); padding: 0 8px; border-radius: 8px; }
.hero p { font-size: 17px; opacity: .95; }
.hero .greet { font-size: 14px; opacity: .9; margin-bottom: 8px; }
.next-card { background: #fff; color: var(--c-text); border-radius: 20px; padding: 24px; box-shadow: 0 16px 40px rgba(0,0,0,.15); }
.next-card .label { font-size: 12px; color: var(--c-primary); font-weight: 700; letter-spacing: .1em; }
.next-card h3 { font-size: 20px; margin: 6px 0; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }

.progress-wrap { margin-top: -36px; position: relative; z-index: 2; }
.progress-bar { height: 12px; background: var(--c-line); border-radius: 999px; overflow: hidden; margin: 10px 0 4px; }
.progress-bar span { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .6s; }

/* 研修スケジュール（トップ画像内） */
.schedule-card { padding: 20px 22px; }
.schedule-next { background: var(--c-warn-light); border-radius: 12px; padding: 12px 14px; margin: 10px 0 12px; border-left: 4px solid var(--c-warn); }
.sn-label { font-size: 12px; font-weight: 700; color: var(--c-warn); }
.sn-days { background: var(--c-warn); color: #fff; border-radius: 999px; padding: 0 8px; margin-left: 6px; }
.sn-title { font-weight: 700; font-size: 15px; line-height: 1.5; margin: 2px 0; }
.sn-meta { font-size: 13px; color: var(--c-sub); }
.schedule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.schedule-list a { display: grid; grid-template-columns: 24px 74px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; color: var(--c-text); font-size: 13px; }
.schedule-list a:hover { background: var(--c-sky-light); text-decoration: none; }
.sch-no { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--c-sky-light); color: var(--c-primary); }
.sch-date { color: var(--c-sub); white-space: nowrap; }
.sch-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-done a { color: var(--c-sub); }
.sch-done .sch-no { background: #f0eee6; color: var(--c-sub); }
.sch-next a { background: var(--c-warn-light); font-weight: 700; }
.sch-next .sch-no { background: var(--c-warn); color: #fff; }
.schedule-foot { font-size: 12px; color: var(--c-sub); text-align: right; margin-top: 8px; }

.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.next-video { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.roadmap { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; margin-top: 18px; }
.roadmap-step { text-align: center; font-size: 12px; color: var(--c-sub); }
.roadmap-step .dot {
  width: 40px; height: 40px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center;
  background: #f0eee6; font-weight: 700; color: var(--c-sub); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--c-line);
}
.roadmap-step.done .dot { background: var(--c-mint); color: #fff; box-shadow: 0 0 0 2px var(--c-mint); }
.roadmap-step.current .dot { background: var(--c-primary); color: #fff; box-shadow: 0 0 0 4px rgba(201,100,66,.25); }
.roadmap-step.current { color: var(--c-primary); font-weight: 700; }
@media (max-width: 700px) { .roadmap { grid-template-columns: repeat(5, 1fr); row-gap: 14px; } }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--c-line); font-size: 15px; align-items: baseline; flex-wrap: wrap; }
.news-list li:last-child { border-bottom: 0; }
.news-list time { color: var(--c-sub); font-size: 13px; min-width: 90px; }

/* ---------- 動画 ---------- */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(135deg, #0d3b66, #136f63); box-shadow: var(--shadow);
}
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; padding: 20px; }
.video-placeholder .play {
  width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.2); margin: 0 auto 12px;
  display: grid; place-items: center; font-size: 30px; border: 2px solid rgba(255,255,255,.5);
}
.video-placeholder small { opacity: .8; }

.video-card { padding: 0; overflow: hidden; cursor: pointer; }
.video-card .thumb { aspect-ratio: 16/9; background: var(--grad); position: relative; display: grid; place-items: center; color: #fff; }
.video-card .thumb .no { font-size: 42px; font-weight: 800; opacity: .9; }
.video-card .thumb .dur { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); padding: 0 8px; border-radius: 6px; font-size: 12px; }
.video-card .thumb .watched { position: absolute; left: 10px; top: 10px; background: #fff; color: #5f7048; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.video-card .body { padding: 16px 18px 20px; }
.video-card h3 { font-size: 16px; margin-bottom: 6px; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.chip {
  border: 1px solid var(--c-line); background: #fff; border-radius: 999px; padding: 6px 16px;
  font-size: 14px; cursor: pointer; font-family: inherit; color: var(--c-sub);
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.chip.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 700; }
.search-input { flex: 1; min-width: 200px; max-width: 320px; margin-left: auto; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--c-line); font-family: inherit; font-size: 14px; }
.search-input:focus { outline: none; border-color: var(--c-primary); }

/* モーダル */
.modal { position: fixed; inset: 0; background: rgba(31,30,29,.6); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-body { background: #fff; border-radius: 20px; width: 100%; max-width: 900px; max-height: 90vh; overflow: auto; padding: 24px; position: relative; }
.modal-close { position: absolute; right: 14px; top: 10px; background: none; border: 0; font-size: 28px; cursor: pointer; color: var(--c-sub); }

/* ---------- 第0回 説明資料 ---------- */
.lesson-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.lesson-side { position: sticky; top: 84px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--c-sub); font-size: 14px; }
.toc li a:hover { background: var(--c-sky-light); color: var(--c-primary); text-decoration: none; }
@media (max-width: 960px) { .lesson-layout { grid-template-columns: 1fr; } .lesson-side { position: static; } }

.slide { background: #fff; border-radius: var(--radius); border: 1px solid var(--c-line); box-shadow: var(--shadow); padding: 32px; margin-bottom: 24px; scroll-margin-top: 84px; }
.slide .slide-no { font-size: 12px; font-weight: 700; color: var(--c-primary); letter-spacing: .1em; }
.slide h2 { font-size: 22px; margin-top: 4px; }
.point-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.point-list li { padding: 12px 16px 12px 44px; background: var(--c-bg); border-radius: 12px; position: relative; }
.point-list li::before { content: "✓"; position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; border-radius: 50%; background: var(--c-mint); color: #fff; font-size: 12px; display: grid; place-items: center; font-weight: 700; }

.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: flow; }
.flow-item { background: var(--c-sky-light); border-radius: 14px; padding: 16px 12px; text-align: center; position: relative; font-size: 14px; }
.flow-item b { display: block; font-size: 15px; margin-bottom: 4px; color: var(--c-primary-dark); }
.flow-item .n { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; margin: 0 auto 8px; font-weight: 800; }
.flow-item:not(:last-child)::after { content: "›"; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--c-primary); font-weight: 700; }
.flow.flow-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 760px) { .flow, .flow.flow-6 { grid-template-columns: 1fr; } .flow-item:not(:last-child)::after { content: "⌄"; right: 50%; top: auto; bottom: -20px; transform: translateX(50%); } }

.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 12px; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.compare th { background: var(--c-bg); font-size: 13px; color: var(--c-sub); }
.compare td:first-child { font-weight: 700; white-space: nowrap; }

.code-block { position: relative; background: #2b2a27; color: #f5f4ee; border-radius: 12px; padding: 16px 18px; font-size: 14px; overflow-x: auto; margin: 10px 0 16px; white-space: pre-wrap; word-break: break-all; }
.copy-btn { position: absolute; right: 8px; top: 8px; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 6px; padding: 3px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.copy-btn:hover { background: rgba(255,255,255,.25); }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist label { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--c-bg); cursor: pointer; transition: .2s; }
.checklist input { width: 20px; height: 20px; accent-color: var(--c-mint); flex-shrink: 0; }
.checklist input:checked + span { color: var(--c-sub); text-decoration: line-through; }

.callout { border-radius: 12px; padding: 14px 18px; font-size: 14px; margin: 14px 0; }
.callout-info { background: var(--c-sky-light); border-left: 4px solid var(--c-primary); }
.callout-tip { background: var(--c-mint-light); border-left: 4px solid var(--c-mint); }
.callout-warn { background: var(--c-warn-light); border-left: 4px solid var(--c-warn); }

/* ---------- ダウンロード ---------- */
.dl-item { display: flex; gap: 16px; align-items: center; padding: 18px 20px; }
.dl-item .file-icon { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0; }
.ft-pdf { background: #e5534b; } .ft-xlsx { background: #2e9b5f; } .ft-txt { background: #5e5d59; } .ft-md { background: #5e5d59; } .ft-zip { background: #8e6ad8; } .ft-pptx { background: #e67e22; } .ft-docx { background: #2b579a; }
.dl-item .info { flex: 1; min-width: 0; }
.dl-item h3 { font-size: 16px; margin: 0 0 2px; }
.dl-item p { margin: 0; font-size: 13px; color: var(--c-sub); }
.industry-banner { display: flex; align-items: center; gap: 18px; background: #fff; border: 2px solid var(--c-mint); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 28px; flex-wrap: wrap; }
.industry-banner .big { font-size: 40px; }
.industry-banner h2 { margin: 0; font-size: 20px; }
details.other-industries summary { cursor: pointer; font-weight: 700; color: var(--c-primary); padding: 8px 0; }

/* ---------- チャットボット ---------- */
.chat-wrap { max-width: 860px; margin: 0 auto; }
.chat-box { background: #fff; border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--c-line); display: flex; flex-direction: column; height: min(70vh, 640px); overflow: hidden; }
.chat-head { padding: 14px 20px; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; gap: 12px; }
.chat-head .avatar, .msg .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; font-size: 15px; }
.chat-head .status { font-size: 12px; color: #5f7048; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; background: var(--c-bg); display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg .bubble { background: #fff; border: 1px solid var(--c-line); padding: 12px 16px; border-radius: 4px 16px 16px 16px; font-size: 15px; }
.msg .bubble p:last-child { margin: 0; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--c-primary); color: #fff; border-color: var(--c-primary); border-radius: 16px 4px 16px 16px; }
.msg.user .avatar { background: #cfd8e3; color: var(--c-text); }
.msg .bubble a.inline-link { font-weight: 700; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c-sub); margin: 0 2px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px; border-top: 1px solid var(--c-line); }
.suggest .chip { font-size: 13px; padding: 4px 12px; }
.chat-input { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--c-line); }
.chat-input textarea { flex: 1; resize: none; border: 2px solid var(--c-line); border-radius: 12px; padding: 10px 14px; font-family: inherit; font-size: 15px; height: 48px; }
.chat-input textarea:focus { outline: none; border-color: var(--c-primary); }

/* ---------- Q&A ---------- */
.faq-cat { margin-bottom: 36px; }
.faq-item { background: #fff; border: 1px solid var(--c-line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 52px 16px 56px; font-weight: 700; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "Q"; position: absolute; left: 18px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--c-primary); color: #fff; display: grid; place-items: center; font-size: 14px; }
.faq-item summary::after { content: "+"; position: absolute; right: 20px; top: 12px; font-size: 22px; color: var(--c-primary); transition: .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .answer { padding: 0 24px 18px 56px; position: relative; color: #34475b; }
.faq-item .answer::before { content: "A"; position: absolute; left: 18px; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--c-mint); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700; }

/* ---------- 途中で分からなくなった方へ ---------- */
.help-hero { background: linear-gradient(135deg, #d4a27f 0%, #c08552 100%); }
.stuck-card { border-top: 4px solid var(--c-warn); }
.stuck-card ol { padding-left: 1.2em; margin: 0; font-size: 14px; }
.stuck-card ol li { margin-bottom: 6px; }
.rescue { display: grid; gap: 16px; }
.rescue-item { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
.rescue-item .num { width: 56px; height: 56px; border-radius: 16px; background: var(--grad); color: #fff; font-size: 22px; font-weight: 800; display: grid; place-items: center; }
.contact-box { background: var(--grad); color: #fff; border-radius: 20px; padding: 32px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.contact-box h2 { margin: 0 0 4px; }
.contact-box p { margin: 0; opacity: .95; }

/* ---------- フッター ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--c-line); padding: 28px 0; margin-top: 40px; font-size: 13px; color: var(--c-sub); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-inner nav a { color: var(--c-sub); }

/* トースト */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px); background: #1f1e1d; color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .3s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* フローティング：チャットへのショートカット */
.fab-chat { position: fixed; right: 22px; bottom: 22px; width: 60px; height: 60px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 24px rgba(201,100,66,.4); z-index: 60; }
.fab-chat:hover { text-decoration: none; transform: scale(1.06); }

/* =========================================================
   管理画面
   ========================================================= */
body.loading main, body.loading .site-footer { visibility: hidden; }
.admin-head { background: linear-gradient(135deg, #3d3929 0%, #c96442 100%); padding: 32px 0 36px; }
.admin-head h1 { font-size: 28px; }
.admin-header .logo-mark { background: linear-gradient(135deg, #3d3929, #c96442); }
.nav a.nav-admin { color: #3d3929; border: 1px solid var(--c-line); }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 2px solid var(--c-line); }
.admin-tabs button { background: none; border: 0; padding: 10px 16px; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--c-sub); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.admin-tabs button:hover { color: var(--c-primary); }
.admin-tabs button.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { font-size: 22px; margin-bottom: 4px; }
.panel-head p { color: var(--c-sub); font-size: 14px; margin: 0; max-width: 720px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; background: var(--c-bg); color: var(--c-sub); font-size: 12px; padding: 10px 14px; white-space: nowrap; }
.admin-table td { padding: 12px 14px; border-top: 1px solid var(--c-line); vertical-align: top; }
.admin-table.compact td { padding: 8px 4px; }
.admin-table td.actions { white-space: nowrap; text-align: right; }
.admin-table tr:hover td { background: #fdfcf9; }
.btn-xs { padding: 3px 10px; font-size: 12px; border-width: 1px; }
.btn.danger { color: #e53935; border-color: #f3c2c0; }
.btn.danger:hover { background: #fdecea; }
.empty-note { color: var(--c-sub); text-align: center; padding: 28px 0; margin: 0; }
.field-help { font-size: 12px; color: var(--c-sub); margin-top: 4px; }
.req { font-size: 11px; background: #fdecea; color: #e53935; padding: 0 6px; border-radius: 4px; margin-left: 4px; }
.check-inline { display: flex; gap: 8px; align-items: center; font-weight: 500 !important; }
select.form-control { padding: 10px 12px; }
.stat-label { font-size: 13px; color: var(--c-sub); font-weight: 700; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--c-primary-dark); line-height: 1.4; margin: 4px 0; }
.stat-num small { font-size: 14px; color: var(--c-sub); }
.stat-num.warn { color: var(--c-warn); }
.stat-sub { font-size: 12px; color: var(--c-sub); }

/* 第0回：各自で実施の案内 */
.self-notice { display: flex; gap: 14px; align-items: flex-start; background: var(--c-warn-light); border: 2px solid #ecd9bf; border-radius: var(--radius); padding: 18px 20px; margin-top: 20px; }
.self-notice-icon { font-size: 28px; line-height: 1; }
.self-notice strong { color: #b4541a; }
.self-notice p { font-size: 14px; margin: 6px 0 12px; }
.sch-self a { background: var(--c-mint-light); }
.sch-self .sch-no { background: var(--c-mint); color: #fff; }
.admin-table .badge { white-space: nowrap; }

/* 用語ポップアップ */
.term { border-bottom: 2px dotted var(--c-mint); cursor: help; text-decoration: none; }
.term:hover, .term:focus { background: var(--c-mint-light); outline: none; border-bottom-style: solid; }
.term-tip { position: fixed; z-index: 300; background: #1f1e1d; color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.7; box-shadow: 0 10px 28px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.term-tip.show { opacity: 1; transform: translateY(0); }
.term-tip b { display: block; color: #f0b8a2; font-size: 12px; margin-bottom: 2px; }
.term-tip::after { content: ""; position: absolute; left: var(--arrow, 50%); bottom: -6px; width: 12px; height: 12px; background: #1f1e1d; transform: translateX(-50%) rotate(45deg); }
.term-tip.below::after { bottom: auto; top: -6px; }
@media print { .term { border-bottom: 0; } .term-tip { display: none; } }

/* Claude風：見出しの書体 */
:root { --serif: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif; }
h1, h2, .section-title, .hero h1, .page-head h1, .login-visual h1, .next-card h3 { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; }
.logo span { font-family: var(--serif); }

/* スマホでは比較表を横スクロールに（文字が1文字ずつ折り返さないように） */
@media (max-width: 640px) {
  .compare { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .compare th, .compare td { min-width: 120px; font-size: 13px; padding: 10px; }
  .compare td:first-child { min-width: 90px; }
}
.lesson-layout > * { min-width: 0; }
.slide { min-width: 0; }

/* 期（コース）の切り替え */
.user-box .course-switch { display: inline-flex; align-items: center; gap: 4px; background: var(--c-primary-light, #f6ebe4); color: #a8502f; padding: 2px 4px 2px 10px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.user-box .course-switch select { border: none; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; max-width: 200px; }
.check-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--c-line, #e8e6dc); border-radius: 10px; background: #fdfcf9; }
/* ヘッダーが窮屈な幅では、期を優先して業種の表示を省く（業種はダウンロードページで確認できます） */
@media (min-width: 1201px) and (max-width: 1440px) {
  .user-box .course-switch ~ .ind-chip, .user-box .course-chip ~ .ind-chip { display: none; }
}
.user-box .course-chip, .user-box .course-switch select { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }

/* ダウンロード：完成イメージのポップアップ */
.img-chip { margin-top: 8px; background: var(--c-sky-light); color: var(--c-primary-dark); border: 0; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }
.img-chip:hover { background: #f0dccf; }
.dl-item[data-img] { cursor: zoom-in; }
.dl-item[data-img] .dl-btn { cursor: pointer; }
.img-pop { position: fixed; z-index: 300; width: min(560px, calc(100vw - 32px)); background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(31,30,29,.28); padding: 10px; pointer-events: none; opacity: 0; transition: opacity .15s; left: -9999px; top: 0; }
.img-pop.show { opacity: 1; }
.img-pop img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 8px; }
.img-pop-cap { font-size: 13px; font-weight: 700; color: var(--c-text); margin: 2px 4px 8px; }
.img-pop-load { padding: 40px 0; text-align: center; color: var(--c-sub); font-size: 13px; }
.img-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(31,30,29,.7); display: grid; place-items: center; padding: 16px; }
.img-overlay-body { position: relative; background: #fff; border-radius: 14px; padding: 12px; max-width: 1100px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; }
.img-overlay-body img { display: block; width: 100%; height: auto; border-radius: 8px; }
.img-close { position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); font-size: 22px; cursor: pointer; z-index: 1; }

/* チャットボット：出典など */
.bot-sources { font-size: 12px; color: var(--c-sub); margin-top: 8px !important; border-top: 1px dashed var(--c-line); padding-top: 6px; }

/* 右下の小窓チャット */
.fab-chat { border: 0; cursor: pointer; }
.fab-chat.hide { display: none; }
.cw-panel { position: fixed; right: 22px; bottom: 22px; width: 380px; height: min(560px, calc(100vh - 44px)); z-index: 250;
  background: #fff; border: 1px solid var(--c-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(31,30,29,.25);
  display: none; flex-direction: column; overflow: hidden; }
.cw-panel.open { display: flex; }
.cw-panel.max { top: 16px; left: 16px; right: 16px; bottom: 16px; width: auto; height: auto; }
.cw-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--grad); color: #fff; }
.cw-head .avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.22); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.cw-title { flex: 1; min-width: 0; line-height: 1.3; }
.cw-title strong { font-size: 15px; }
.cw-title .status { font-size: 11px; opacity: .9; }
.cw-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(255,255,255,.16); color: #fff; font-size: 17px; cursor: pointer; flex-shrink: 0; }
.cw-btn:hover { background: rgba(255,255,255,.3); }
.cw-panel .chat-log { padding: 14px; gap: 12px; }
.cw-panel .msg { max-width: 94%; }
.cw-panel .msg .avatar { width: 30px; height: 30px; font-size: 12px; }
.cw-panel .msg .bubble { font-size: 14px; padding: 10px 13px; }
.cw-panel .suggest { flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; }
.cw-panel .suggest .chip { white-space: nowrap; flex-shrink: 0; }
.cw-panel .chat-input { padding: 10px 12px; gap: 8px; }
.cw-panel .chat-input textarea { height: 44px; font-size: 14px; padding: 9px 12px; }
.cw-foot { padding: 0 12px 8px; font-size: 11px; color: var(--c-sub); display: flex; flex-direction: column; gap: 2px; }
.cw-quota { font-weight: 700; }
.cw-panel.max .chat-log { padding: 20px max(20px, calc((100% - 860px) / 2)); }
body.cw-lock { overflow: hidden; }
@media (max-width: 600px) {
  .cw-panel, .cw-panel.max { top: 0; left: 0; right: 0; bottom: 0; width: auto; height: auto; border-radius: 0; border: 0; }
  .cw-max { display: none; }
}

/* ダウンロード：一覧と説明ページ */
a.dl-item { color: inherit; text-decoration: none; }
a.dl-item:hover { text-decoration: none; }
.dl-more { color: var(--c-primary); font-weight: 700; font-size: 13px; white-space: nowrap; }
.dl-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.dl-tag { font-size: 11px; font-weight: 700; background: var(--c-sky-light); color: var(--c-primary-dark); padding: 1px 8px; border-radius: 999px; }
.dl-tag.gray { background: #f0eee6; color: var(--c-sub); }
.dd-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.dd-layout > * { min-width: 0; }
.dd-side { position: sticky; top: 84px; }
.dd-lead { font-size: 17px; font-weight: 500; margin-bottom: 20px; }
.dd-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 12px; align-items: start; }
.dd-gallery.one { grid-template-columns: 1fr; }
.dd-fig { margin: 0; background: #fff; border: 1px solid var(--c-line); border-radius: 14px; padding: 8px; cursor: zoom-in; }
.dd-img { min-height: 120px; display: grid; place-items: center; background: #faf9f6; border-radius: 8px; overflow: hidden; }
.dd-img img { display: block; width: 100%; height: auto; }
.dd-fig figcaption { font-size: 13px; color: var(--c-sub); padding: 6px 4px 0; text-align: center; }
.dd-detail { background: #fff; border: 1px solid var(--c-line); border-radius: 16px; padding: 8px 24px 20px; }
.dd-item { padding-top: 14px; }
.dd-item + .dd-item { border-top: 1px dashed var(--c-line); margin-top: 14px; }
.dd-item h3 { font-size: 15px; color: var(--c-primary-dark); margin: 0 0 4px; }
.dd-item p { margin: 0; }
.dd-item ul { margin: 6px 0 0; padding-left: 1.3em; }
.dd-download .btn { width: 100%; }
.dd-dl-note { font-size: 12px; color: var(--c-sub); margin-top: 8px; }
.dd-mobile-dl { display: none; margin-top: 20px; }
@media (max-width: 900px) {
  .dd-layout { grid-template-columns: 1fr; }
  .dd-side .card { display: none; }
  .dd-side { position: static; }
  .dd-mobile-dl { display: block; }
  .dd-gallery { grid-template-columns: 1fr; }
}

/* 使うAI（Claude Code／Codex）ごとの出し分け */
[data-ai-only="codex"] { display: none !important; }
html[data-ai="codex"] [data-ai-only="codex"] { display: revert !important; }
html[data-ai="codex"] [data-ai-only="claude"] { display: none !important; }
.ai-chip { background: #eef3f9; color: #3d5a80; padding: 2px 10px; border-radius: 999px; font-weight: 700; white-space: nowrap; font-size: 12px; }

/* ---------- ヘッダーが横にはみ出さないように（11/20） ----------
   クラス名が長い・管理者の選び欄が多いときは、ヘッダーの中で折り返す */
@media (min-width: 1201px) {
  .header-inner { height: auto; min-height: 64px; padding-top: 6px; padding-bottom: 6px; }
  .nav-wrap { flex: 1 1 0; min-width: 0; flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
  .nav { flex-wrap: wrap; justify-content: flex-end; }
  .user-box { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; min-width: 0; }
}
.user-box .course-switch { max-width: 100%; min-width: 0; }
.user-box .course-switch select { max-width: 16em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .course-chip { max-width: 16em; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1200px) {
  .site-header.open .user-box { flex-wrap: wrap; row-gap: 8px; }
  .site-header.open .user-box .course-switch select { max-width: min(16em, calc(100vw - 120px)); }
}

/* ---------- ログイン：パスワードの表示／隠す・スタッフ用の欄 ---------- */
.pass-wrap { position: relative; }
.pass-wrap .form-control { padding-right: 72px; }
.pass-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: #fff; border: 1px solid var(--c-line); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 13px; font-weight: 700; color: var(--c-primary-dark); cursor: pointer; }
.pass-toggle:hover { border-color: var(--c-primary); }
.staff-login { margin-top: 28px; padding-top: 10px; border-top: 1px solid var(--c-line); font-size: 12px; color: var(--c-sub); text-align: center; }
.staff-login summary { cursor: pointer; display: list-item; list-style-position: inside; padding: 4px 8px; }
.staff-login p { font-size: 12px; margin: 6px 0 10px; }

/* ---------- トップ：講義の当日の帯 ---------- */
.today-bar { background: var(--c-warn-light, #fbeee2); border-bottom: 2px solid var(--c-primary); padding: 10px 0; }
.today-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.today-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.today-when { font-weight: 800; color: var(--c-primary); white-space: nowrap; }
.today-title { font-weight: 700; color: var(--c-text); }
.today-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.today-wait { font-size: 13px; font-weight: 700; color: var(--c-sub); background: #fff; border: 1px dashed var(--c-line); border-radius: 999px; padding: 4px 12px; }
@media (max-width: 600px) {
  .today-btns { width: 100%; }
  .today-btns .btn { flex: 1 1 auto; justify-content: center; text-align: center; }
}

/* ---------- スマホ：右下のチャットの丸ボタンが、中身に重ならないように ---------- */
@media (max-width: 600px) {
  .fab-chat { width: 48px; height: 48px; font-size: 21px; right: 10px; bottom: 12px; }
  /* 予定一覧の右端の札（「予定」など）が、丸ボタンの通り道に入らないよう少し内側へ */
  .schedule-list { margin-right: 14px; }
  .schedule-list a { gap: 6px; grid-template-columns: 22px 66px 1fr auto; }
  .site-footer { padding-bottom: 84px; }
}

/* ---------- ダウンロード：各回の資料のまとまり ---------- */
.dl-lesson-head { font-size: 16px; margin: 24px 0 10px; color: var(--c-primary-dark, #a8502f); }
.dl-lesson-head:first-child { margin-top: 0; }

/* ---------- 過去動画：これからの回（講義予定）は薄めに ---------- */
.video-card.upcoming { opacity: .62; }
.video-card.upcoming:hover { opacity: .9; }
.videos-sub { font-size: 18px; margin: 40px 0 6px; }
.videos-sub-note { color: var(--c-sub); font-size: 14px; margin: 0 0 14px; }
