/* 見た目は画面イメージ（https://claude.ai/artifact/R2BoSpyUyxifHyuNSfC9iL ）に合わせる */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-sub: #fafafb;
  --text: #16191f;
  --text-2: #3a404c;
  --muted: #5a6170;
  --line: #e2e5ea;
  --line-soft: #eef0f3;
  --input: #c9ced6;
  --accent: #0b6e63;
  --accent-dark: #08554c;
  --accent-soft: #e3f2ef;
  --accent-faint: #f2f9f7;
  --accent-text: #ffffff;
  --warn-bg: #fff1e0;
  --warn: #8a4300;
  --info-bg: #e8eefb;
  --info: #2747a0;
  --gray-bg: #edeef1;
  --gray: #4a505c;
  --danger-bg: #fff6f4;
  --danger: #a3321e;
  --dark: #16191f;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, sans-serif; line-height: 1.7; font-size: 15px; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 24px; margin: 0; line-height: 1.4; }
h2 { font-size: 18px; margin: 0; line-height: 1.5; }
h3 { font-size: 16px; margin: 0; }
p { margin: 0; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; background: var(--bg); padding: 2px 6px; border-radius: 4px; }

/* ヘッダー（受講者・組織管理者） */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); flex-shrink: 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 20px; font-size: 14px; flex-grow: 1; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 20px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.site-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.site-user form { margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.container > * { min-width: 0; }

/* ログイン前（ログイン・招待・修了証の確認） */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.auth-box > .brand { justify-content: center; font-size: 18px; }
.auth-box > .brand .brand-mark { width: 32px; height: 32px; }
.auth-box h1 { font-size: 20px; text-align: center; }
.auth-box .card { padding: 32px; }

/* 部品 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.muted-card { background: var(--surface-sub); }
.narrow { max-width: 520px; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { font-size: 12px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > legend { font-size: 14px; font-weight: 500; }
.field input, .field textarea, .field select, .inline-form input, .inline-form select {
  font: inherit; font-size: 15px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%;
}
.inline-form input, .inline-form select { width: auto; }
.field textarea { line-height: 1.7; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .inline-form input:focus, .inline-form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
fieldset.field { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 0; }
.field .checkbox, .checkbox { display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 44px; font-weight: 400; }
.checkbox input { width: auto; min-height: 0; }

.button, .link-button { font: inherit; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--input); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.button:hover { color: var(--text); background: var(--bg); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--accent-text); }
.button.outline { border-color: var(--accent); color: var(--accent); }
.button.outline:hover { background: var(--accent-faint); color: var(--accent); }
.button.block { width: 100%; min-height: 48px; font-size: 15px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.link-button { background: none; border: none; color: var(--accent); text-decoration: underline; padding: 0; min-height: 44px; font-size: 14px; }
.link-button.plain { color: var(--muted); text-decoration: none; }
.link-button.plain:hover { color: var(--text); }

.flash { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin: 0; }
.flash.notice { background: var(--accent-soft); color: var(--accent-dark); }
.flash.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3c9c0; }
ul.flash { padding-left: 32px; }
.notice-box { padding: 12px 16px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }

.tag, .badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--bg); color: var(--muted); line-height: 1.5; align-self: flex-start; }
.tag.green, .badge.done, .badge.active { background: var(--accent-soft); color: var(--accent-dark); }
.tag.orange, .badge.invited { background: var(--warn-bg); color: var(--warn); }
.tag.blue { background: var(--info-bg); color: var(--info); }
.tag.gray, .badge.suspended { background: var(--gray-bg); color: var(--gray); }
td .tag, td .badge { align-self: auto; }

.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: none; border-radius: 999px; background: var(--line); overflow: hidden; flex: 1 1 auto; color: var(--accent); }
.bar::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.bar::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.bar.thin { height: 6px; }
.bar.inline { display: inline-block; width: 120px; flex: 0 0 120px; vertical-align: middle; margin-right: 8px; }
.bar.off::-webkit-progress-value { background: #9aa1ad; }
.bar.off::-moz-progress-bar { background: #9aa1ad; }
.bar-line { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.page-head > h1, .page-head > h2 { flex-grow: 1; }
.page-head form { margin: 0; }
.section { display: flex; flex-direction: column; gap: 16px; }
.back-link { font-size: 14px; text-decoration: none; align-self: flex-start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 0; }
.stats > div { display: flex; flex-direction: column; gap: 6px; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 0; font-size: 18px; font-weight: 700; }
.stats .sub { font-size: 13px; color: var(--muted); font-weight: 400; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { font-size: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tr.is-off td { color: var(--muted); }
.table td form { margin: 0; display: inline; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 組織管理：組織の表示と切り替え、タブ */
.org-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.org-bar .org-name { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.org-bar .org-name strong { font-size: 16px; color: var(--text); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.tabs a { text-decoration: none; padding: 10px 0; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }

/* コース一覧 */
.greeting { display: flex; flex-direction: column; gap: 4px; }
.greeting p { color: var(--muted); font-size: 14px; }
.resume { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 24px; }
.resume-body { flex: 1 1 360px; display: flex; flex-direction: column; gap: 8px; }
.resume-body h2 { font-size: 20px; }
.resume-body p { font-size: 14px; color: var(--muted); }
.course-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.course-card { display: flex; flex-direction: column; gap: 12px; height: 100%; text-decoration: none; color: var(--text); }
a.course-card:hover { color: var(--text); border-color: var(--accent); }
.course-card h3 { font-size: 17px; }
.course-card p { font-size: 14px; color: var(--muted); }
.course-card.locked h3 { color: var(--gray); }
.course-card .push { margin-top: auto; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.chips li { padding: 12px 16px; font-size: 14px; color: var(--muted); }

/* コース詳細 */
.course-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; }
.course-head-main { flex: 1 1 480px; display: flex; flex-direction: column; gap: 8px; }
.course-head-main h1 { font-size: 26px; }
.course-head-main p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.progress-card { flex: 0 1 300px; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.progress-card .line { display: flex; justify-content: space-between; font-size: 14px; }
.lesson-list { list-style: none; padding: 0; margin: 0; }
.card.flush > .lesson-row:first-child { border-top: none; }
.lesson-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; }
.lesson-list-head h2 { font-size: 16px; flex-grow: 1; }
.lesson-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 20px; border-top: 1px solid var(--line); font-size: 14px; text-decoration: none; color: var(--text); }
a.lesson-row:hover { background: var(--accent-faint); color: var(--text); }
.lesson-row.is-next { background: var(--accent-faint); font-weight: 700; }
.lesson-row .grow { flex-grow: 1; }
.lesson-row .state { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
.lesson-row.is-next .state { color: var(--accent); font-weight: 700; }
.dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--input); }
.dot.done { background: var(--accent); border-color: var(--accent); }
.dot.next { border-color: var(--accent); }

/* レッスン */
.lesson-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--text); border-radius: 8px; flex-shrink: 0; }
.icon-link:hover { background: var(--surface); color: var(--text); }
.lesson-head .titles { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.lesson-head .titles span { font-size: 12px; color: var(--muted); }
.lesson-head h1 { font-size: 20px; }
.lesson-panes { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.lesson-panes.one-column { flex-direction: column; flex-wrap: nowrap; }
.lesson-panes.one-column > .pane { flex: none; }
.pane { flex: 1 1 560px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.pane.side { flex: 1 1 420px; }
.pane-head { padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; margin: 0; font-weight: 400; }
.pane-body { flex-grow: 1; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.pane-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.pane-foot form { margin: 0; }
.lesson-body { overflow-x: auto; font-size: 16px; line-height: 1.9; color: var(--text-2); }
.lesson-body p + p { margin-top: 1em; }
.topic { background: var(--bg); border-radius: 10px; padding: 14px 16px; font-size: 14px; line-height: 1.8; }

/* 運営管理 */
.ops-header { background: var(--dark); color: #fff; }
.ops-header-inner { padding: 0 24px; min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.ops-header .brand { color: #fff; font-size: 15px; flex-grow: 1; }
.ops-header .brand-mark { width: 24px; height: 24px; border-radius: 6px; }
.ops-header .who { font-size: 13px; color: var(--input); }
.ops-header a, .ops-header .link-button { color: var(--input); font-size: 13px; }
.ops-header a:hover, .ops-header .link-button:hover { color: #fff; }
.ops-header form { margin: 0; }
.ops-shell { display: flex; flex-wrap: wrap; gap: 24px; padding: 24px; }
.ops-side { flex: 1 1 200px; max-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.ops-side a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px; font-size: 14px; text-decoration: none; color: var(--text-2); }
.ops-side a:hover { background: var(--surface); color: var(--text); }
.ops-side a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.ops-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ops-main h1 { font-size: 22px; }
@media (max-width: 720px) {
  .ops-side { max-width: none; flex-direction: row; flex-wrap: wrap; }
}

/* 修了証 */
.certificate { text-align: center; padding: 48px 24px; display: flex; flex-direction: column; gap: 16px; }
.certificate-label { font-size: 32px; font-weight: 700; letter-spacing: .5em; }
.certificate-name { font-size: 22px; }
.qr { display: block; margin: 0 auto; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; }
  .certificate { border: 2px solid var(--text); }
}
.narrow.center { align-self: center; }
.grow { flex-grow: 1; }
.bar-line > span { white-space: nowrap; }

/* 請求書・領収書 */
.invoice-parties { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.invoice-customer { font-size: 18px; }
.invoice-total { font-size: 22px; margin-left: 8px; }
.invoice-sum { display: flex; flex-direction: column; gap: 4px; align-self: flex-end; min-width: 260px; margin: 0; }
.invoice-sum > div { display: flex; justify-content: space-between; gap: 24px; }
.invoice-sum dd { margin: 0; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; }
.table tr.is-alert td { background: var(--danger-bg); }
.center-text { text-align: center; }
.table td .inline-form select { min-height: 36px; padding: 4px 8px; font-size: 13px; }
.table td .link-button { min-height: 36px; margin-right: 8px; }
pre.topic { white-space: pre-wrap; margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.inline-form input.link-button, .inline-form input.button { width: auto; }
.inline-form input.link-button { border: none; background: none; padding: 0; }
.inline-form input[type=text], .inline-form input[type=email] { flex: 1 1 180px; min-width: 0; max-width: 100%; }

/* 法定ページ・よくある質問・フッター */
.legal h2 { font-size: 16px; margin-top: 8px; }
.legal p, .legal li { font-size: 14px; line-height: 1.9; }
.legal-table th { width: 30%; white-space: normal; color: var(--text); font-size: 13px; }
.legal-table td { white-space: normal; }
.faq { border-top: 1px solid var(--line); padding: 0 20px; }
.faq:first-child { border-top: none; }
.faq summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font-weight: 500; font-size: 14px; }
.faq p { padding: 0 0 16px; color: var(--text-2); }
.site-footer { border-top: 1px solid var(--line); padding: 20px 24px 32px; font-size: 13px; }
.site-footer nav { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.making-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.making-steps > li { display: flex; gap: 14px; align-items: flex-start; }
.making-day { flex: none; min-width: 64px; padding: 4px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13px; font-weight: 700; text-align: center; }
.making-steps h3 { margin: 2px 0 4px; font-size: 16px; }
.making-steps p, .making-steps ul { margin: 0; font-size: 14px; color: var(--text-2); }
.making-steps ul { padding-left: 1.2em; list-style: disc; }
.making-table th, .making-table td { white-space: normal; width: 50%; }
.making-cta { border: 2px solid var(--accent); background: var(--accent-faint); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* 教材のエディタ（#55） */
.editor { display: flex; flex-direction: column; gap: 12px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.tool { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--input); border-radius: 6px; background: var(--surface); font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.tool:hover { background: var(--bg); }
.tool:focus-within, .tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.preview-frame { border: 1px dashed var(--input); border-radius: 12px; padding: 16px; background: var(--bg); margin: 0 auto; width: 100%; }
.preview-frame[data-width="phone"] { max-width: 390px; }
.preview-frame[data-width="phone"] .pane { flex-basis: 100%; }
.slide-preview { border-bottom: 1px dashed var(--line); padding-bottom: 16px; }

/* 教材の本文（Markdown） */
.lesson-body h1, .lesson-body h2, .lesson-body h3 { color: var(--text); margin: 0 0 12px; line-height: 1.5; }
.lesson-body h1 { font-size: 26px; } .lesson-body h2 { font-size: 22px; } .lesson-body h3 { font-size: 18px; }
.lesson-body ul, .lesson-body ol { padding-left: 1.5em; margin: 0 0 1em; }
.lesson-body p { margin: 0 0 1em; }
.lesson-body img { max-width: 100%; height: auto; border-radius: 8px; }
.lesson-body table { border-collapse: collapse; margin: 0 0 1em; font-size: 14px; display: block; overflow-x: auto; }
.lesson-body th, .lesson-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.lesson-body th { background: var(--bg); }
.lesson-body pre { background: var(--bg); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.7; margin: 0 0 1em; }
.lesson-body code { font-family: ui-monospace, Menlo, monospace; }
.lesson-body pre code { background: none; padding: 0; }
.lesson-body blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.markdown-alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 1em; background: var(--info-bg); color: var(--info); font-size: 14px; }
.markdown-alert p { margin: 0; }
.markdown-alert-title { font-weight: 700; }
.markdown-alert-tip, .markdown-alert-important { background: var(--accent-soft); color: var(--accent-dark); }
.markdown-alert-warning, .markdown-alert-caution { background: var(--warn-bg); color: var(--warn); }

/* スライド（#14） */
.slides { display: flex; flex-direction: column; gap: 16px; }
.slide { min-height: 240px; }
.slides.is-enhanced .slide[hidden] { display: none; }
.slide-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.slide-dots span { width: 20px; height: 6px; border-radius: 3px; background: var(--line); }
.slide-dots span.on { background: var(--accent); }
.button.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.button.dark:hover { background: #000; color: #fff; }
.pane-title { font-size: 13px; font-weight: 400; color: var(--muted); margin: 0; }
