﻿:root {
  --primary: #2563ab;
  --primary-dark: #163e73;
  --primary-light: #e9f1fa;
  --accent: #c9a227;
  --accent-light: #f7f0da;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #1f2a26;
  --muted: #6b7a74;
  --border: #dde4e1;
  --danger: #c0392b;
  --danger-light: #fdecea;
  --success: #1e8e5a;
  --success-light: #e6f5ee;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-display: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  letter-spacing: 0.01em;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
a { color: var(--primary); }

.loading { padding: 3rem; text-align: center; color: var(--muted); }

/* ---------- レイアウト ---------- */
.topbar {
  background: #ffffff;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; }
.topbar .user-area {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.topbar .user-area .cert-mark {
  background: var(--accent);
  color: #3a2e00;
  padding: 0.1rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.topbar button.logout {
  background: #ffffff;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.topbar button.logout:hover { background: var(--primary-light); }

/* グローバルナビ（PC） */
.gnav {
  background: #fafbfa;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  padding: 0 1rem;
}
.gnav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  padding: 0.85rem 0.15rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.gnav a:hover { color: var(--primary); }
.gnav a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ページヒーロー */
.hero {
  background: linear-gradient(105deg, var(--primary-dark) 0%, var(--primary) 55%, #35a3d6 100%);
  color: #ffffff;
}
.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 2.4rem 2rem;
}
.hero-icon {
  width: 64px;
  height: 64px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hero-icon svg { width: 28px; height: 28px; color: var(--primary); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: 0.14em;
}
.hero-en { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em; opacity: 0.85; margin-top: 0.15rem; }

.shell { display: block; }

/* サイドバー（モバイルドロワー専用） */
.sidebar {
  display: none;
  width: 240px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--primary-light); }
.sidebar a.active {
  background: var(--primary-light);
  border-left-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 700;
}
.sidebar .nav-section {
  font-size: 0.7rem;
  color: var(--muted);
  padding: 1rem 1.25rem 0.25rem;
  letter-spacing: 0.08em;
}

.main { max-width: 1080px; margin: 0 auto; padding: 2rem 2rem 4rem; }

.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  color: var(--primary-dark);
}
.page-sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.25rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card h3 { margin-bottom: 0.75rem; font-size: 1.05rem; color: var(--primary-dark); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--primary-dark);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
}
.backdrop { display: none; }

.ch-actions { display: flex; flex-direction: column; gap: 0.5rem; flex-shrink: 0; }

/* ---------- レスポンシブ ---------- */
/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.secondary:hover { background: var(--primary-light); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 0.3rem 0.8rem; font-size: 0.8rem; border-radius: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- ログイン ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 60%, #35a3d6 100%);
  padding: 1rem;
}
.login-box {
  background: #fff;
  border-radius: 0;
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.login-box .logo { text-align: center; margin-bottom: 1.5rem; }
.login-box .logo .org-logo { max-width: 280px; width: 100%; height: auto; margin-bottom: 0.75rem; }
.login-box .logo h1 { font-size: 1.05rem; color: var(--primary-dark); margin-top: 0.25rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.login-box .btn { width: 100%; margin-top: 0.5rem; }
.error-msg {
  background: var(--danger-light);
  color: var(--danger);
  border-radius: 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.info-msg {
  background: var(--success-light);
  color: var(--success);
  border-radius: 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.login-note { margin-top: 1.25rem; font-size: 0.75rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 0.9rem; }

/* ---------- ダッシュボード ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1rem 1.25rem;
}
.stat-tile .label { font-size: 0.78rem; color: var(--muted); }
.stat-tile .value { font-size: 1.7rem; font-weight: 700; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.stat-tile .value small { font-size: 0.9rem; font-weight: 400; color: var(--muted); }

.progress-bar { background: #e5ebe8; border-radius: 0; height: 10px; overflow: hidden; margin-top: 0.4rem; }
.progress-bar > div { background: var(--primary); height: 100%; border-radius: 0; transition: width 0.4s; }

.cert-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(120deg, #fdf6e0, #f7ecc8);
  border: 1px solid #e3cf8f;
  border-radius: 0;
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}
.cert-banner .icon { font-size: 2rem; }
.cert-banner .title { font-weight: 700; color: #6b5200; }
.cert-banner .sub { font-size: 0.83rem; color: #8a7433; }

.announce-item { border-bottom: 1px solid var(--border); padding: 0.7rem 0; }
a.announce-link { display: block; text-decoration: none; color: var(--text); }
a.announce-link:hover { background: var(--primary-light); }
a.announce-link .title { color: var(--primary); }
a.announce-link:hover .title { text-decoration: underline; }

.news-article { max-width: 780px; padding: 1.75rem 2rem; }
.news-article .news-date { font-size: 0.8rem; color: var(--muted); }
.news-article .news-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
  margin: 0.3rem 0 1.1rem;
}
.news-article .news-body { white-space: pre-wrap; font-size: 0.95rem; }
.announce-item:last-child { border-bottom: none; }
.announce-item .date { font-size: 0.75rem; color: var(--muted); }
.announce-item .title { font-weight: 600; font-size: 0.95rem; }
.announce-item .body { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; white-space: pre-wrap; }

/* ---------- テキスト学習 ---------- */
.chapter-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.9rem;
}
.chapter-card .ch-title { font-weight: 700; color: var(--primary-dark); }
.chapter-card .ch-summary { font-size: 0.83rem; color: var(--muted); margin-top: 0.2rem; }
.chapter-card .ch-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; display: flex; gap: 0.8rem; align-items: center; }
.tag {
  display: inline-block;
  border-radius: 0;
  padding: 0.05rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.tag.done { background: var(--success-light); color: var(--success); }
.tag.pending { background: #eef1f0; color: var(--muted); }
.tag.gold { background: var(--accent-light); color: #8a6d00; }

.reader { max-width: 780px; }
.reader .section-block { margin-bottom: 2rem; }
.reader h2.sec-title {
  font-size: 1.1rem;
  color: var(--primary-dark);
  border-left: 4px solid var(--primary);
  padding-left: 0.7rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.reader .sec-body { white-space: pre-wrap; font-size: 0.95rem; }
.reader .read-btn { flex-shrink: 0; }
.edition-note { font-size: 0.78rem; color: var(--muted); background: var(--accent-light); border-radius: 0; padding: 0.5rem 0.9rem; margin-bottom: 1rem; }

.chapter-nav { display: flex; justify-content: space-between; margin-top: 2rem; gap: 1rem; flex-wrap: wrap; }

/* ---------- テスト ---------- */
.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.question-card .q-no { font-size: 0.78rem; font-weight: 700; color: var(--primary); }
.question-card .q-text { font-weight: 600; margin: 0.3rem 0 0.8rem; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 0.92rem;
}
.choice:hover { background: var(--primary-light); }
.choice.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.choice.correct { border-color: var(--success); background: var(--success-light); }
.choice.wrong { border-color: var(--danger); background: var(--danger-light); }
.choice input { margin-top: 0.35rem; }
.explanation {
  background: #f6f8f7;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
.result-banner {
  border-radius: 0;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.result-banner.pass { background: var(--success-light); border: 1px solid var(--success); }
.result-banner.fail { background: var(--danger-light); border: 1px solid var(--danger); }
.result-banner .score { font-size: 2.2rem; font-weight: 700; }
.result-banner.pass .score { color: var(--success); }
.result-banner.fail .score { color: var(--danger); }

.exam-timer {
  position: sticky;
  top: 70px;
  z-index: 10;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 0;
  padding: 0.6rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.exam-timer .time { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.exam-timer.warn { background: var(--danger); }

/* ---------- テーブル ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  background: var(--card);
}
table.data th, table.data td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: middle;
}
table.data th { background: #f0f4f2; font-size: 0.78rem; color: var(--muted); }
table.data tr:hover td { background: #fafcfb; }
.table-wrap { overflow-x: auto; }

/* ---------- 認定証 ---------- */
/* 認定証：画像の台紙（1122×1402）に文字を重ねる。位置・サイズは台紙の幅に対する割合（cqw）で指定 */
.cert-wrap { container-type: inline-size; width: min(100%, 760px); margin: 0 auto; }
.certificate {
  position: relative; width: 100%; aspect-ratio: 1122 / 1402;
  font-family: 'Shippori Mincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  color: #1a1a1a; box-shadow: 0 6px 24px rgba(0,0,0,0.12); overflow: hidden; background: #f7f5eb;
}
.certificate .cert-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.certificate > div { position: absolute; left: 0; right: 0; text-align: center; white-space: nowrap; }
.certificate .cert-no { top: 8cqw; right: 8cqw; left: auto; font-size: 2.1cqw; letter-spacing: 0.08em; color: #333; }
.certificate .cert-title { top: 26cqw; font-size: 8.6cqw; font-weight: 700; letter-spacing: 0.06em; line-height: 1; }
.certificate .cert-heading { top: 36cqw; font-size: 6.4cqw; font-weight: 600; letter-spacing: 0.12em; line-height: 1; }
.certificate .cert-name { top: 52cqw; left: 23cqw; right: 23cqw; padding-bottom: 2cqw; border-bottom: 0.18cqw solid #8a6d2b; line-height: 1; }
.certificate .cert-name-text { font-size: 5.6cqw; font-weight: 700; letter-spacing: 0.1em; }
.certificate .cert-dono { font-size: 3.4cqw; font-weight: 600; margin-left: 2.2cqw; }
.certificate .cert-body { top: 64cqw; left: 15.6cqw; right: 15.6cqw; text-align: left; white-space: normal; font-size: 3.2cqw; line-height: 1.62; letter-spacing: 0.05em; color: #222; }
.certificate .cert-date { top: 90.8cqw; font-size: 2.35cqw; letter-spacing: 0.08em; line-height: 1; }
.certificate .cert-org { top: 96.4cqw; font-size: 4.1cqw; font-weight: 700; letter-spacing: 0.1em; line-height: 1; }
.certificate .cert-rep { top: 103.6cqw; line-height: 1; }
.certificate .cert-rep-title { font-size: 2.6cqw; margin-right: 2.4cqw; letter-spacing: 0.1em; }
.certificate .cert-rep-name { font-size: 4cqw; font-weight: 600; letter-spacing: 0.14em; }
.certificate .cert-tagline { top: 113cqw; font-size: 2cqw; letter-spacing: 0.14em; color: #7d6530; line-height: 1; }
.cert-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 1.5rem; margin-top: 1rem; font-size: 0.88rem; color: var(--muted); }
.cert-actions { text-align: center; margin-top: 1.25rem; }

@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .cert-wrap, .cert-wrap * { visibility: visible; }
  .cert-wrap { position: fixed; top: 0; left: 0; width: 100%; max-width: none; margin: 0; }
  .certificate { width: 100%; height: auto; aspect-ratio: 1122 / 1402; margin: 0; box-shadow: none; }
  .topbar, .sidebar, .gnav, .hero, .cert-actions, .cert-meta, .page-sub { display: none !important; }
}

/* ---------- 管理 ---------- */
.admin-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .admin-forms { grid-template-columns: 1fr; } }
.mini-progress { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--muted); }
.mini-progress .progress-bar { width: 70px; margin-top: 0; }

/* 保存先未接続時の警告帯 */
.storage-warning {
  background: #fff8e1;
  border: 1px solid #f0c36d;
  border-left: 4px solid #d9930d;
  color: #6b4a05;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
}
.storage-warning strong { color: #a8690a; }

/* ---------- 管理画面（CMS） ---------- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
}
.admin-tabs a {
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -2px;
}
.admin-tabs a:hover { color: var(--primary); background: var(--primary-light); }
.admin-tabs a.active {
  color: var(--primary-dark);
  background: var(--card);
  border-color: var(--border);
  border-bottom: 2px solid var(--card);
}

.admin-alert {
  background: #fff8e1;
  border: 1px solid #f0c36d;
  border-left: 4px solid #d9930d;
  color: #6b4a05;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.adm-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.adm-row:last-child { border-bottom: none; }
.adm-row .date { font-size: 0.75rem; color: var(--muted); }
.adm-row-title { font-weight: 600; font-size: 0.95rem; }
.adm-row-title a { color: var(--primary-dark); text-decoration: none; }
.adm-row-title a:hover { text-decoration: underline; }
.adm-row-sub { font-size: 0.82rem; color: var(--muted); }
.adm-row-meta { font-size: 0.76rem; color: var(--muted); margin-top: 0.2rem; }
.adm-row-actions { display: flex; gap: 0.35rem; flex-shrink: 0; flex-wrap: wrap; align-items: center; }

.btn.small { padding: 0.28rem 0.7rem; font-size: 0.78rem; }
.btn:disabled { opacity: 0.35; cursor: default; }

.detail-meta { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.85rem; color: var(--muted); }

.sec-editor { border: 1px solid var(--border); padding: 1rem; margin-bottom: 1rem; background: #fbfcfc; }
.sec-editor-head { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.6rem; }
.sec-title-input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
}
.sec-editor textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.9;
  margin-bottom: 0.6rem;
}

.q-card { padding-top: 1rem; }
.q-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.choice-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.choice-radio { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; font-weight: 700; color: var(--primary-dark); }
.choice-radio input { width: auto; }
.choice-row > input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
}
.q-card textarea, .card form textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.form-msg:empty { display: none; }

@media (max-width: 640px) {
  .adm-row { flex-direction: column; }
  .sec-editor-head { flex-direction: column; align-items: stretch; }
}

/* ---- 加盟店 ---- */
.store-filter { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; font-size: 0.9rem; }
.store-filter label { color: var(--muted); }
.store-filter select { padding: 0.45rem 0.7rem; border: 1px solid var(--border, #d8dee6); border-radius: 6px; background: #fff; font-size: 0.9rem; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.store-card { margin: 0; }
.store-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.6rem; }
.store-name { margin: 0; font-size: 1.05rem; }
.store-row { display: flex; gap: 0.75rem; font-size: 0.88rem; margin: 0.25rem 0; word-break: break-all; }
.store-label { flex: 0 0 3.5em; color: var(--muted); }
.store-body { margin: 0.75rem 0 0; font-size: 0.88rem; line-height: 1.7; white-space: pre-wrap; }

/* ---------- 受講申込フォーム（ログイン不要） ---------- */
.apply-link {
  display: block;
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--primary-light);
  text-decoration: none;
}
.apply-link:hover { background: #dbe8f6; }
.apply-wrap {
  min-height: 100vh;
  background: linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 60%, #35a3d6 100%);
  padding: 2.5rem 1rem;
}
.apply-box {
  background: #fff;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.apply-box .logo { text-align: center; margin-bottom: 1.25rem; }
.apply-box .logo .org-logo { max-width: 260px; width: 100%; height: auto; }
.apply-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--primary-dark);
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.apply-lead { font-size: 0.88rem; margin-bottom: 1.25rem; }
.apply-lead .req-note { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
.apply-section {
  font-size: 0.95rem;
  color: var(--primary-dark);
  border-left: 4px solid var(--primary);
  padding-left: 0.6rem;
  margin: 1.6rem 0 0.9rem;
}
.req { color: var(--danger); font-weight: 700; }
.radio-group, .check-group { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; }
/* .field label の display:block / 文字色より優先させる */
.radio-item, .check-item, .field .radio-item, .field .check-item {
  display: inline-flex;
  color: var(--text);
  font-weight: 400;
  margin-bottom: 0;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  cursor: pointer;
  line-height: 1.5;
}
.radio-item input, .check-item input, .field .radio-item input, .field .check-item input {
  width: auto; padding: 0; margin: 0.3rem 0 0; flex-shrink: 0; accent-color: var(--primary);
}
.radio-item:hover, .check-item:hover { background: var(--primary-light); }
.radio-item:has(input:checked), .check-item:has(input:checked) { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }
.years-input { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.years-input input { width: 110px; text-align: right; }
.years-hint { font-size: 0.78rem; color: var(--muted); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.agree-box { margin: 1.5rem 0 1rem; }
.agree-box .check-item { display: flex; font-size: 0.82rem; color: var(--text); }
.apply-submit { width: 100%; padding: 0.9rem; font-size: 1rem; }
.apply-back { margin-top: 1.25rem; text-align: center; font-size: 0.85rem; }
.apply-done {
  text-align: center;
  background: var(--accent-light);
  border: 1px solid #e6d59a;
  padding: 1.25rem;
  margin: 1rem 0 1.25rem;
}
.apply-done .receipt-label { font-size: 0.78rem; color: #8a6d00; letter-spacing: 0.1em; }
.apply-done .receipt-no { font-size: 1.6rem; font-weight: 700; color: #6b5200; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }

/* 受講プラン・料金 */
.plan-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.plan-item, .field .plan-item {
  display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0; font-weight: 400;
  border: 1px solid var(--border); padding: 0.9rem 1rem; cursor: pointer; line-height: 1.5;
}
.plan-item:hover { background: var(--primary-light); }
.plan-item:has(input:checked) { border-color: var(--primary); background: var(--primary-light); box-shadow: inset 0 0 0 1px var(--primary); }
.plan-item input, .field .plan-item input { width: auto; padding: 0; margin: 0.35rem 0 0; flex-shrink: 0; accent-color: var(--primary); }
.plan-body { display: flex; flex-direction: column; gap: 0.15rem; color: var(--text); }
.plan-name { font-weight: 700; font-size: 0.95rem; color: var(--primary-dark); }
.plan-desc { font-size: 0.8rem; color: var(--muted); }
.plan-price { font-size: 0.85rem; margin-top: 0.3rem; }
.plan-price strong { font-size: 1.05rem; color: var(--primary-dark); }
.plan-price small { font-size: 0.72rem; color: var(--muted); margin-left: 0.2rem; }
.fee-box { background: var(--accent-light); border: 1px solid #e6d59a; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.fee-title { font-weight: 700; color: #6b5200; font-size: 0.9rem; margin-bottom: 0.5rem; }
.fee-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; background: #fff; }
.fee-table th, .fee-table td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; vertical-align: top; }
.fee-table th { width: 11em; background: #f7f7f2; font-weight: 600; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.fee-table small { color: var(--muted); font-size: 0.76rem; }
.fee-note { font-size: 0.76rem; color: #7d6530; margin-top: 0.5rem; }

/* 管理画面：受講申込 */
.tab-badge {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.4em;
  margin-left: 0.4em;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
  vertical-align: middle;
}
.stat-tile.attention { border-color: #f0c36d; background: #fff8e1; }
.stat-tile.attention .value { color: #a8690a; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 1rem; }
.tag.status-new { background: var(--danger-light); color: var(--danger); }
.tag.status-contacted { background: var(--accent-light); color: #8a6d00; }
.tag.status-issued { background: var(--success-light); color: var(--success); }
.tag.status-rejected { background: #eef1f0; color: var(--muted); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.detail-table th { white-space: nowrap; }
.pw-row { display: flex; gap: 0.5rem; align-items: stretch; }
.pw-row input { flex: 1; }
.pw-row .btn { white-space: nowrap; }

/* ---------- モバイル用の上書き（基本の指定より後ろに置くこと） ---------- */
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .main { padding: 1rem 0.9rem 3rem; }
  .apply-wrap { padding: 1rem 0.75rem 2rem; }
  .apply-box { padding: 1.75rem 1.25rem 1.5rem; }
  .radio-group, .check-group { flex-direction: column; }
  .plan-group { grid-template-columns: 1fr; }
  .fee-table th { width: 7em; white-space: normal; }
  .radio-item, .check-item { width: 100%; }
  .detail-table th { width: 8.5em !important; white-space: normal; }

  /* トップバー */
  .topbar { padding: 0 0.75rem; gap: 0.5rem; }
  .brand-logo { height: 28px; }
  .topbar .user-area { gap: 0.5rem; flex-shrink: 0; }
  .topbar .user-area .cert-mark { display: none; }
  .menu-toggle { display: block; }

  /* PCナビは隠してドロワーに切替 */
  .gnav { display: none; }
  .hero-inner { padding: 1.4rem 1rem; gap: 0.9rem; }
  .hero-icon { width: 48px; height: 48px; }
  .hero-icon svg { width: 22px; height: 22px; }
  .hero-title { font-size: 1.2rem; letter-spacing: 0.1em; }

  /* ドロワーナビ */
  .sidebar {
    display: block;
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 240px;
    max-width: 80vw;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.25); }
  .backdrop.show {
    display: block;
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(0,0,0,0.45);
    z-index: 25;
  }

  /* ダッシュボード */
  .page-title { font-size: 1.2rem; }

  /* テキスト学習 */
  .reader h2.sec-title { flex-wrap: wrap; font-size: 1rem; }
  .reader .sec-body { font-size: 0.92rem; }
  .chapter-nav { flex-direction: column; }
  .chapter-nav .btn { width: 100%; }

  /* テスト・試験 */
  .question-card { padding: 1rem; }
  .choice { padding: 0.6rem 0.7rem; }
  .exam-timer { top: 70px; padding: 0.5rem 0.8rem; flex-wrap: wrap; gap: 0.3rem; }
  .exam-timer .time { font-size: 1.1rem; }
  .result-banner { padding: 1rem; }
  .result-banner .score { font-size: 1.8rem; }

  /* ログイン */
  .login-box { padding: 1.75rem 1.25rem; }


}

@media (max-width: 800px) {
  /* ダッシュボード・管理の統計タイル */
  .stat-tiles { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .stat-tile { padding: 0.8rem 0.9rem; }
  .stat-tile .value { font-size: 1.4rem; }

  /* テキスト学習の章カード */
  .chapter-card { flex-direction: column; align-items: stretch; gap: 0.75rem; padding: 1rem; }
  .ch-actions { flex-direction: row; }
  .ch-actions .btn { flex: 1; white-space: nowrap; padding-left: 0.5rem; padding-right: 0.5rem; text-align: center; }
  .chapter-card .ch-meta { flex-wrap: wrap; gap: 0.4rem 0.8rem; }
  .chapter-card .ch-meta > span:first-child { white-space: nowrap; }

  /* 表は横スクロールさせ、セル内で1文字ずつ折り返さない（長文セルは .wrap で折り返し可） */
  table.data { font-size: 0.8rem; }
  table.data th, table.data td { padding: 0.45rem 0.5rem; }
  .table-wrap table.data th, .table-wrap table.data td { white-space: nowrap; }
  .table-wrap table.data td.wrap { white-space: normal; min-width: 14rem; }
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* 管理画面のタブは1段で横スクロール */
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -0.9rem; margin-right: -0.9rem; padding: 0 0.9rem; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs a { white-space: nowrap; padding: 0.55rem 0.85rem; flex-shrink: 0; }

  /* 一覧行・バナー */
  .cert-banner .sub > span { white-space: nowrap; }
  .adm-row { flex-wrap: wrap; }
  .adm-row-actions { width: 100%; }
  .detail-meta { flex-wrap: wrap; }
  .mini-progress { white-space: nowrap; }
}

@media (max-width: 400px) {
  .stat-tiles { gap: 0.5rem; }
  .stat-tile { padding: 0.7rem 0.75rem; }
  .stat-tile .value { font-size: 1.25rem; }
  .topbar .user-name { display: none; }
}

/* ---------- 同意書（申込時・認定時） ---------- */
.consent-list { display: flex; flex-direction: column; gap: 1rem; margin: 0.5rem 0 1.25rem; }
.consent-item { border: 1px solid var(--border); background: var(--card); }
.consent-title { font-weight: 700; font-size: 0.95rem; color: var(--primary-dark); padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); background: var(--primary-light); }
.consent-body {
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
  line-height: 1.8;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
  color: var(--text);
}
.consent-check, .consent-item .check-item { display: flex; margin: 0; border: 0; border-top: 1px solid var(--border); width: 100%; font-size: 0.86rem; }
.consent-item .check-item:has(input:checked) { background: var(--success-light); border-color: var(--border); }
.cert-banner.pending-consent { background: var(--primary-light); border-color: var(--primary); }
.cert-banner.pending-consent .title { color: var(--primary-dark); }
.cert-banner.pending-consent .sub { color: var(--text); }

/* 同意書の編集（管理） */
.consent-editor { display: flex; flex-direction: column; gap: 0.9rem; }
.consent-editor-row { border: 1px solid var(--border); padding: 0.8rem 1rem; background: var(--bg); }
.consent-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; gap: 0.5rem; }

/* ---------- 試験回 ---------- */
.exam-entry { border-left: 4px solid var(--primary); }
.exam-entry h3 { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- 協賛企業 ---------- */
.sponsor-section { margin: 1.5rem auto 0; max-width: 960px; width: 100%; }
.sponsor-section.compact { margin-top: 0.5rem; }
.sponsor-heading {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.7rem;
}
.sponsor-heading::before, .sponsor-heading::after { content: ""; display: inline-block; width: 28px; height: 1px; background: var(--border); vertical-align: middle; margin: 0 0.7rem; }
.sponsor-banners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-bottom: 0.8rem; }
.sponsor-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.sponsor-banner:hover { border-color: var(--primary); }
.sponsor-logo { max-width: 100%; max-height: 64px; width: auto; height: auto; display: block; }
.sponsor-name-only { font-weight: 600; font-size: 0.95rem; text-align: center; }
.sponsor-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem; font-size: 0.82rem; color: var(--muted); }
.sponsor-list a { color: var(--muted); text-decoration: none; }
.sponsor-list a:hover { color: var(--primary); text-decoration: underline; }

.sponsor-logo-edit { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.sponsor-logo-preview {
  width: 200px; height: 80px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  padding: 0.4rem;
  flex-shrink: 0;
}
.sponsor-logo-preview.small { width: 96px; height: 44px; padding: 0.2rem; }
.sponsor-logo-preview img { max-width: 100%; max-height: 100%; display: block; }
.embed-code {
  background: #1f2a26; color: #e9f1fa;
  font-size: 0.78rem; padding: 0.8rem 1rem;
  white-space: pre-wrap; word-break: break-all;
  margin: 0.5rem 0;
}

@media (max-width: 640px) {
  .sponsor-banners { grid-template-columns: 1fr; }
  .sponsor-banner { min-height: 70px; }
  .consent-body { max-height: 180px; }
}
.save-state { font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.save-state.warn { color: var(--danger); font-weight: 600; }
/* 試験タイマー（濃い背景）上の保存状態は明るい色で表示する */
.exam-timer .save-state { color: rgba(255, 255, 255, 0.85); }
.exam-timer .save-state.warn { color: #ffe08a; }
/* 管理タブ（スマホで横スクロール）：右側にまだタブがあることを示すフェード */
@media (max-width: 640px) {
  .admin-tabs-wrap { position: relative; }
  .admin-tabs-wrap::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 2px; width: 44px; pointer-events: none;
    background: linear-gradient(to right, rgba(244, 246, 245, 0), var(--bg) 80%);
  }
}
.consent-body:focus { outline: 2px solid var(--primary); outline-offset: -2px; }
.hero-title:focus, .apply-title:focus { outline: none; }

/* ---------- 教科書本文（小見出し・図・表） ---------- */
.reader .sec-body { white-space: normal; line-height: 2.05; letter-spacing: 0.06em; }
.reader .sec-body p { margin: 0 0 1.3rem; white-space: pre-wrap; }
.reader .sec-body p:last-child { margin-bottom: 0; }
.tb-h3 {
  font-size: 1.02rem; font-weight: 700; color: var(--primary-dark);
  margin: 1.6rem 0 0.7rem; padding-left: 0.7rem; border-left: 4px solid var(--primary);
}
.tb-h4 { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 1.2rem 0 0.5rem; }
.tb-figure { margin: 1.6rem 0 1.8rem; text-align: center; }
.tb-figure img { max-width: 100%; height: auto; border: 1px solid var(--border); background: #fff; }
.tb-figure figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; text-align: left; }
.tb-caption { font-size: 0.82rem; color: var(--muted); margin: -0.4rem 0 1rem; }
/* 教科書本文の強調（**太字** ／ !!赤字!! ／ ==マーカー== ／ ++大きく++） */
.reader .sec-body strong { font-weight: 700; }
.tb-key { color: #c62828; }
.tb-exam { background: linear-gradient(transparent 55%, #ffe36e 55%); color: inherit; padding: 0 0.1em; font-weight: 700; }
.tb-big { font-size: 1.2em; font-weight: 700; }
.tb-legend { font-size: 0.82rem; color: var(--muted); margin: 0 0 1rem; }
.tb-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }
.tb-qlist { font-size: 0.85rem; padding-left: 1.3rem; margin-top: 0.6rem; }
.tb-qlist li { margin-bottom: 0.7rem; }
.tb-qans { color: #c62828; font-weight: 700; }
.tb-qexp { color: var(--muted); }
.tb-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 0.4rem 0 1rem; }
.tb-table th, .tb-table td { border: 1px solid var(--border); padding: 0.4rem 0.55rem; vertical-align: top; text-align: left; white-space: pre-wrap; }
.tb-table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.reader .table-wrap { overflow-x: auto; }

/* ---------- 動画学習 ---------- */
.video-progress { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.video-progress .label { font-size: 0.78rem; color: var(--muted); }
.video-progress .value { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); }
.video-progress .value small { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.video-select { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.video-select .field { margin: 0; }
.video-select select { width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--border); background: #fff; font-size: 0.95rem; }
.video-cat-head { margin: 0.4rem 0 0.8rem; }
.video-cat-head h2 { font-size: 1.15rem; color: var(--primary-dark); margin-bottom: 0.2rem; }
.video-cat-head p { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.4rem; }
.video-group { margin-bottom: 1.4rem; }
.video-group-title { font-size: 0.95rem; font-weight: 700; color: var(--primary-dark); border-left: 4px solid var(--primary); padding-left: 0.6rem; margin-bottom: 0.6rem; }
.video-item {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--card); border: 1px solid var(--border);
  padding: 0.8rem 1rem; margin-bottom: 0.5rem; text-decoration: none; color: var(--text);
  transition: border-color 0.15s;
}
.video-item:hover { border-color: var(--primary); }
.video-item.watched { background: #f7fbf8; }
.vi-no { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--primary-dark); color: #fff; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.video-item.watched .vi-no { background: var(--success); }
.vi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vi-title { font-weight: 600; font-size: 0.95rem; }
.vi-meta { font-size: 0.8rem; color: var(--muted); }
.vi-state { flex-shrink: 0; }
.video-crumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.2rem; }
.vi-count { margin-left: 0.4rem; }
.video-frame { position: relative; width: 100%; max-width: 960px; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder {
  max-width: 960px; aspect-ratio: 16 / 9; background: var(--primary-dark); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem;
}
.video-placeholder .vp-badge { border: 1px solid rgba(255,255,255,0.7); padding: 0.25rem 0.9rem; font-size: 0.85rem; letter-spacing: 0.15em; margin-bottom: 0.8rem; }
.video-placeholder p { font-size: 0.9rem; max-width: 520px; opacity: 0.9; }
.video-points { padding-left: 1.3rem; font-size: 0.95rem; }
.video-points li { margin-bottom: 0.35rem; }
.video-related { list-style: none; padding: 0; }
.video-related li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; flex-wrap: wrap; }
.video-related li:last-child { border-bottom: 0; }
.vr-ch { font-size: 0.78rem; color: var(--muted); }
.video-admin-item { border: 1px solid var(--border); padding: 0.8rem 1rem; margin-top: 0.8rem; background: var(--bg); }
@media (max-width: 640px) {
  .video-select { grid-template-columns: 1fr; }
  .video-placeholder { aspect-ratio: auto; padding: 1.4rem 1rem; }
  .video-item { padding: 0.7rem 0.8rem; }
}

/* 動画学習：段階式の選択（大分類タイル → 中分類タブ → 動画） */
.video-step { display: flex; align-items: center; gap: 0.6rem; margin: 1.4rem 0 0.7rem; flex-wrap: wrap; }
.step-no { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: var(--primary-dark); color: #fff; font-weight: 700; flex-shrink: 0; }
.step-title { font-weight: 700; font-size: 1.05rem; color: var(--primary-dark); }
.step-hint { font-size: 0.8rem; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.cat-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; text-align: left;
  background: var(--card); border: 2px solid var(--border); padding: 0.8rem 0.9rem 0.7rem; cursor: pointer;
  font-family: inherit; color: var(--text); position: relative; transition: border-color 0.15s, background 0.15s;
}
.cat-tile:hover { border-color: var(--primary); }
.cat-tile.selected { border-color: var(--primary); background: var(--primary-light); }
.cat-tile.selected::after { content: "選択中"; position: absolute; top: 0; right: 0; background: var(--primary); color: #fff; font-size: 0.7rem; padding: 0.1rem 0.5rem; }
.cat-tile.complete .cat-no { background: var(--success); }
.cat-no { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--primary-dark); color: #fff; font-weight: 700; font-size: 0.85rem; }
.cat-title { font-weight: 700; font-size: 0.95rem; line-height: 1.4; }
.cat-meta { font-size: 0.76rem; color: var(--muted); }
.cat-progress { display: block; width: 100%; height: 5px; background: #e5eae8; margin-top: 0.3rem; }
.cat-progress span { display: block; height: 100%; background: var(--primary); }
.group-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.4rem; }
.group-tab {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--card); border: 2px solid var(--border); padding: 0.5rem 0.9rem; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.group-tab small { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.group-tab:hover { border-color: var(--primary); }
.group-tab.active { border-color: var(--primary); background: var(--primary-dark); color: #fff; }
.group-tab.active small { color: rgba(255,255,255,0.8); }
.vi-state .btn.small { padding: 0.35rem 0.9rem; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cat-grid { grid-template-columns: 1fr; } .step-hint { width: 100%; margin-left: 2.4rem; } }

/* ---------- 設定・保有資格者一覧 ---------- */
.topbar .user-icon { width: 30px; height: 30px; object-fit: cover; border: 1px solid var(--border); display: block; }
.topbar .settings-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.8rem;
  padding: 0.35rem 0.6rem; border: 1px solid transparent;
}
.topbar .settings-link svg { width: 16px; height: 16px; }
.topbar .settings-link:hover, .topbar .settings-link.active { background: var(--primary-light); border-color: var(--primary-light); }

.settings-card { max-width: 760px; }
.settings-card h3 { margin-bottom: 0.8rem; }
.radio-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.4rem 0 1rem; }
.opt-mark { font-size: 0.7rem; font-weight: 500; color: var(--muted); border: 1px solid var(--border); padding: 0 0.35rem; margin-left: 0.4rem; vertical-align: 0.1em; }
.field-note { font-size: 0.78rem; color: var(--muted); }
.static-value { padding: 0.35rem 0; font-weight: 600; }
.static-value .field-note { font-weight: 400; margin-left: 0.5rem; }

.icon-edit { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.icon-preview {
  width: 120px; height: 120px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 0.8rem; color: var(--muted); text-align: center;
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.icon-preview.small { width: 72px; height: 72px; font-size: 0.72rem; }
.icon-preview .icon-error { color: var(--danger); padding: 0.4rem; font-size: 0.74rem; line-height: 1.5; }

.listing-choice { border: 1px solid var(--primary); background: var(--card); padding: 1rem 1.1rem; margin: 0.5rem 0 1.25rem; }
.listing-choice-title { font-weight: 700; color: var(--primary-dark); margin-bottom: 0.3rem; }
.listing-choice-note { font-size: 0.82rem; color: var(--muted); line-height: 1.7; margin-bottom: 0.4rem; }
.listing-fields { border-top: 1px solid var(--border); padding-top: 0.8rem; margin-top: 0.4rem; }

.admin-profile { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.admin-profile .detail-table { flex: 1; min-width: 260px; }

.holders-self { background: var(--primary-light); padding: 0.6rem 0.9rem; font-size: 0.86rem; margin-bottom: 1rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.holders-search { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.holders-search label { font-size: 0.85rem; font-weight: 600; }
.holders-search input { flex: 1; min-width: 200px; max-width: 420px; padding: 0.5rem 0.7rem; border: 1px solid var(--border); background: #fff; }
.holders-count { font-size: 0.85rem; color: var(--muted); }
.holders-empty { color: var(--muted); font-size: 0.9rem; padding: 1rem 0; }
.holder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.holder-card { background: var(--card); border: 1px solid var(--border); display: flex; gap: 0.9rem; padding: 1rem; align-items: flex-start; }
.holder-photo {
  width: 88px; height: 88px; flex-shrink: 0; background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; overflow: hidden;
}
.holder-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.holder-body { min-width: 0; flex: 1; }
.holder-name { font-weight: 700; font-size: 1.05rem; color: var(--primary-dark); margin-bottom: 0.3rem; }
.holder-meta { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; font-size: 0.82rem; line-height: 1.6; }
.holder-meta dt { color: var(--muted); white-space: nowrap; }
.holder-meta dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .topbar .settings-link span { display: none; }
  .topbar .settings-link { padding: 0.35rem; }
  .holder-grid { grid-template-columns: 1fr; }
  .holder-photo { width: 72px; height: 72px; }
}

/* ヘッダー：長い氏名は省略し、640px 以下では氏名を出さない（ロゴとメニューボタンが隠れないように） */
.topbar .user-name { max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle { flex-shrink: 0; }
.section-block { scroll-margin-top: 80px; }
@media (max-width: 640px) {
  .topbar .user-name { display: none; }
}
