/* =========================================================
   担当B：コンテンツ系ページ専用（courses / contents / video-library / question-bank / quiz-results / certificates / announcements）
   共通部品（base.css）に無い最小限の表現だけを sm-b- 接頭辞で定義する。色は必ずトークン。
   ========================================================= */

/* サムネイル（コース・動画） */
.sm-b-thumb { width: 64px; aspect-ratio: 16 / 10; border-radius: var(--r-2); background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; flex: 0 0 auto; display: grid; place-items: center; color: var(--ink-3); }
.sm-b-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-b-thumb--lg { width: 100%; max-width: 360px; }
.sm-b-titlecell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sm-b-titlecell__text { min-width: 0; display: flex; flex-direction: column; }
.sm-b-titlecell__text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

/* 統計の小さな並び */
.sm-b-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.sm-b-stats > div { padding: 12px 14px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sm-b-stats span { font-size: var(--fs-sm); color: var(--ink-3); }
.sm-b-stats strong { font-family: var(--font-num); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sm-b-stats strong small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

/* ── コースビルダー ── */
.sm-b-builder { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-5); align-items: start; }
@media (max-width: 1100px) { .sm-b-builder { grid-template-columns: 1fr; } }
.sm-b-builder__side { position: sticky; top: calc(var(--globalbar-h) + var(--grouptabs-h) + 16px); display: flex; flex-direction: column; gap: var(--sp-4); }
@media (max-width: 1100px) { .sm-b-builder__side { position: static; } }
.sm-b-dirty { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--r-3); font-size: var(--fs-sm); color: var(--ink); }
.sm-b-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); margin-bottom: var(--sp-4); }
.sm-b-section.is-drop-target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sm-b-section.is-dragging { opacity: .5; }
.sm-b-section__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.sm-b-section.is-collapsed .sm-b-section__head { border-bottom: 0; }
.sm-b-section.is-collapsed .sm-b-lessons, .sm-b-section.is-collapsed .sm-b-section__foot { display: none; }
.sm-b-section__no { font-family: var(--font-num); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); letter-spacing: .08em; white-space: nowrap; }
.sm-b-section__title { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-b-section__meta { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; }
.sm-b-section__foot { padding: 8px 12px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px dashed var(--line); }
.sm-b-handle { cursor: grab; color: var(--ink-3); display: inline-grid; place-items: center; width: 24px; height: 28px; border-radius: var(--r-1); flex: 0 0 auto; touch-action: none; }
.sm-b-handle:hover { background: var(--surface-3); color: var(--ink); }
.sm-b-handle:active { cursor: grabbing; }
.sm-b-lessons { list-style: none; margin: 0; padding: 4px 0; min-height: 12px; }
.sm-b-lesson { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; min-width: 0; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
.sm-b-lesson:hover { background: var(--surface-2); }
.sm-b-lesson.is-dragging { opacity: .45; }
.sm-b-lesson.is-drop-before { border-top-color: var(--accent); }
.sm-b-lesson.is-drop-after { border-bottom-color: var(--accent); }
.sm-b-lesson__icon { width: 28px; height: 28px; border-radius: var(--r-2); display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-3); color: var(--ink-2); }
.sm-b-lesson__icon[data-type="video"] { background: var(--info-soft); color: var(--info); }
.sm-b-lesson__icon[data-type="text"] { background: var(--accent-soft); color: var(--accent-ink); }
.sm-b-lesson__icon[data-type="pdf"] { background: var(--danger-soft); color: var(--danger); }
.sm-b-lesson__icon[data-type="quiz"] { background: var(--warn-soft); color: var(--warn); }
.sm-b-lesson__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.sm-b-lesson__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-b-lesson__sub { font-size: var(--fs-xs); color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; }
.sm-b-lesson__ops { display: flex; gap: 2px; flex: 0 0 auto; }
.sm-b-lesson__ops .sm-btn--icon { width: 28px; height: 28px; }
.sm-b-empty-sec { padding: 14px 16px; color: var(--ink-3); font-size: var(--fs-sm); }
.sm-b-typepick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 520px) { .sm-b-typepick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .sm-b-lesson__ops .sm-b-move { display: none; }
  .sm-b-section__meta { display: none; }
}

/* 問題（クイズ編集・問題バンク） */
.sm-b-qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sm-b-q { border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px 14px; background: var(--surface); display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.sm-b-q__no { font-family: var(--font-num); font-weight: 700; color: var(--ink-3); min-width: 22px; padding-top: 1px; }
.sm-b-q__main { flex: 1 1 auto; min-width: 0; }
.sm-b-q__text { white-space: pre-wrap; word-break: break-word; }
.sm-b-q__choices { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--ink-2); }
.sm-b-q__choices li.is-correct { color: var(--ok); font-weight: 600; }
.sm-b-q__choices li::before { content: "・"; }
.sm-b-q__choices li.is-correct::before { content: "✓ "; }
.sm-b-q__ops { display: flex; gap: 2px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.sm-b-choice-edit { display: flex; flex-direction: column; gap: 6px; }
.sm-b-choice-edit__row { display: flex; align-items: center; gap: 8px; }
.sm-b-choice-edit__row .sm-input { flex: 1 1 auto; }
.sm-b-choice-edit__row label { flex: 0 0 auto; }

/* 動画ライブラリ */
.sm-b-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--sp-4); }
.sm-b-vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; display: flex; flex-direction: column; min-width: 0; cursor: pointer; transition: border-color var(--dur); }
.sm-b-vcard:hover { border-color: var(--line-strong); }
.sm-b-vcard:focus-visible { outline: none; box-shadow: var(--focus); }
.sm-b-vcard__thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-3); overflow: hidden; }
.sm-b-vcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sm-b-vcard__dur { position: absolute; right: 8px; bottom: 8px; padding: 1px 6px; border-radius: var(--r-1); background: var(--ink); color: var(--surface); font: 600 11px var(--font-num); }
.sm-b-vcard__src { position: absolute; left: 8px; top: 8px; }
.sm-b-vcard__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.sm-b-vcard__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-b-vcard__meta { font-size: var(--fs-xs); color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.sm-b-vcard__foot { display: flex; align-items: center; gap: 4px; padding: 0 8px 8px; }
.sm-b-player { aspect-ratio: 16 / 9; width: 100%; background: #111; border-radius: var(--r-3); overflow: hidden; display: grid; place-items: center; color: #ddd; }
.sm-b-player iframe, .sm-b-player video { width: 100%; height: 100%; border: 0; display: block; }
.sm-b-player img { width: 100%; height: 100%; object-fit: contain; background: var(--surface-3); }
.sm-b-upload-progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.sm-b-upload-progress > i { display: block; height: 100%; width: var(--p, 0%); background: var(--accent); transition: width .2s var(--ease); }

/* 認定証プレビュー（iframe を縮小表示） */
.sm-b-certframe { position: relative; width: 100%; aspect-ratio: 297 / 210; border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: var(--surface-3); }
.sm-b-certframe iframe { position: absolute; left: 0; top: 0; width: 1123px; height: 794px; border: 0; transform-origin: 0 0; background: #fff; }
.sm-b-cert-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 1000px) { .sm-b-cert-split { grid-template-columns: 1fr; } }
.sm-b-varlist { display: flex; flex-wrap: wrap; gap: 4px; }
.sm-b-varlist button { font: 500 11px var(--font-mono); padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.sm-b-varlist button:hover { border-color: var(--accent); color: var(--accent-ink); }
.sm-b-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* 試験結果 */
.sm-b-answer { border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px 14px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; background: var(--surface); }
.sm-b-answer + .sm-b-answer { margin-top: 8px; }
.sm-b-answer__mark { font: 700 16px var(--font-num); text-align: center; padding-top: 1px; }
.sm-b-answer__mark.is-ok { color: var(--ok); }
.sm-b-answer__mark.is-ng { color: var(--danger); }
.sm-b-answer__mark.is-pending { color: var(--warn); }
.sm-b-answer__mark.is-part { color: var(--info); }
.sm-b-answer dl { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 10px; margin: 8px 0 0; font-size: var(--fs-sm); }
.sm-b-answer dt { color: var(--ink-3); }
.sm-b-answer dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.sm-b-grade { margin-top: 10px; padding: 10px 12px; background: var(--warn-soft); border-radius: var(--r-2); display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; }
@media (max-width: 600px) { .sm-b-grade { grid-template-columns: 1fr; } }
.sm-b-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.sm-b-bar__track { flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.sm-b-bar__fill { height: 100%; width: var(--p, 0%); background: var(--accent); }
.sm-b-bar__fill.is-low { background: var(--danger); }
.sm-b-bar__fill.is-mid { background: var(--warn); }
.sm-b-bar span { font: 600 12px var(--font-num); min-width: 36px; text-align: right; }

/* お知らせ */
.sm-b-ann-preview { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.sm-b-ann-preview__img { width: 100%; max-height: 220px; object-fit: cover; display: block; background: var(--surface-3); }
.sm-b-ann-preview__body { padding: 16px 18px; }
.sm-b-ann-preview__body h3 { font-size: var(--fs-lg); font-weight: 700; margin: 6px 0 8px; }
.sm-b-ann-preview__body p { white-space: pre-wrap; color: var(--ink-2); }
.sm-b-ann-preview--urgent { border-left: 3px solid var(--danger); }
.sm-b-ann-preview--important { border-left: 3px solid var(--warn); }
.sm-b-segtabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* 汎用：画像URL入力のプレビュー */
.sm-b-imgprev { width: 96px; height: 60px; border: 1px dashed var(--line-strong); border-radius: var(--r-2); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; color: var(--ink-3); background: var(--surface-2); }
.sm-b-imgprev img { width: 100%; height: 100%; object-fit: contain; }
.sm-b-mono-area { font-family: var(--font-mono); font-size: 12px; }
.sm-b-plan-course { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.sm-b-plan-course:first-child { border-top: 0; }
.sm-b-plan-course > span:first-of-type { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
