/* =====================================================================
   美容外科 医療安全アカデミー — デザインシステム
   基調: 白 / 黒 / シャンパンゴールド #B9A767 / クリーム #F7F5ED
   フォント: Noto Sans JP（見出しアクセントに Noto Serif JP）
   ===================================================================== */

:root {
  --gold: #B9A767;
  --gold-dark: #9C8A4F;
  --gold-light: #D8CCA4;
  --gold-pale: #F1EDDE;
  --cream: #F7F5ED;
  --black: #1C1B17;
  --text: #2B2A26;
  --gray: #787878;
  --gray-light: #B5B0A3;
  --line: #E5E0D1;
  --white: #FFFFFF;
  --danger: #B0483C;
  --ok: #4E7C4E;
  --shadow: 0 2px 14px rgba(28, 27, 23, .07);
  --shadow-lg: 0 10px 34px rgba(28, 27, 23, .14);
  --radius: 12px;
  --header-h: 62px;
  --sidenav-w: 236px;
  --serif: 'Noto Serif JP', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans JP', -apple-system, sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 14.5px;
  line-height: 1.75;
  letter-spacing: .015em;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img, svg, video { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  background: var(--black);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  border-bottom: 2px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-en {
  font-family: var(--serif);
  font-size: 10px; letter-spacing: .34em; color: var(--gold);
}
.brand-ja { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .1em; }

.user-chip { display: flex; align-items: center; gap: 8px; }
.user-name { color: #EDEAE0; font-size: 13px; margin-right: 2px; }
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  padding: 2px 10px; border-radius: 999px; line-height: 1.7;
  white-space: nowrap;
}
.badge-role { color: var(--gold-light); border: 1px solid var(--gold-dark); }
.badge-rank { background: var(--gold); color: #fff; }
.badge-rank.rank-B { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.badge-rank.rank-C { background: transparent; color: var(--gray-light); border: 1px solid var(--gray-light); }

/* ---------- レイアウト ---------- */
.layout { display: flex; padding-top: var(--header-h); min-height: 100vh; }
.sidenav {
  position: fixed; top: var(--header-h); bottom: 0; left: 0; z-index: 40;
  width: var(--sidenav-w);
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 18px 0 12px;
  display: flex; flex-direction: column;
}
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 22px;
  color: var(--text);
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
.nav-item svg {
  width: 21px; height: 21px; flex: none;
  fill: none; stroke: var(--gray); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-item svg .fill { fill: var(--gray); stroke: none; }
.nav-item:hover { background: var(--cream); }
.nav-item.active {
  background: var(--gold-pale);
  border-left-color: var(--gold);
  font-weight: 700;
}
.nav-item.active svg { stroke: var(--gold-dark); }
.nav-item.active svg .fill { fill: var(--gold-dark); }
.nav-label { display: flex; flex-direction: column; line-height: 1.35; font-size: 13.5px; }
.nav-label em {
  font-style: normal; font-family: var(--serif);
  font-size: 9px; letter-spacing: .28em; color: var(--gold);
}
.sidenav-foot {
  margin-top: auto; padding: 16px 22px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--gray-light); line-height: 1.8;
}

.main {
  flex: 1;
  margin-left: var(--sidenav-w);
  padding: 34px 44px 70px;
  max-width: 1120px;
  width: 100%;
}
.boot-loading { color: var(--gray); padding: 60px 0; text-align: center; }

/* ---------- ページ見出し ---------- */
.page-head { margin-bottom: 26px; }
.page-en {
  font-family: var(--serif);
  font-size: 11px; letter-spacing: .32em; color: var(--gold);
  display: block; margin-bottom: 2px;
}
.page-title {
  font-size: 23px; font-weight: 700; letter-spacing: .06em;
  display: flex; align-items: center; gap: 14px;
}
.page-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(to right, var(--gold-light), transparent);
}
.page-lead { color: var(--gray); font-size: 13px; margin-top: 6px; }

.section-title {
  font-size: 16px; font-weight: 700; letter-spacing: .06em;
  margin: 34px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
}
.section-title:first-child { margin-top: 0; }

/* ---------- カード ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.card + .card { margin-top: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }

/* ---------- 統計タイル ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
}
.stat .stat-label { font-size: 11.5px; color: var(--gray); letter-spacing: .08em; }
.stat .stat-value {
  font-family: var(--serif);
  font-size: 30px; line-height: 1.25; color: var(--black);
}
.stat .stat-value small { font-size: 14px; color: var(--gray); font-family: 'Noto Sans JP'; }
.stat.stat-gold { background: linear-gradient(135deg, #C3B278, var(--gold-dark)); border: none; }
.stat.stat-gold .stat-label { color: #F5F0DF; }
.stat.stat-gold .stat-value { color: #fff; }

/* ---------- 動画カード ---------- */
.vcard {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.vcard:not(.locked):hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.thumb {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 150% at 85% -20%, rgba(185,167,103,.5), transparent 55%),
    linear-gradient(135deg, #24211A, #35301F 55%, #4A4128);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.thumb .play {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(185, 167, 103, .92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.thumb .play::after {
  content: ""; margin-left: 4px;
  border-left: 15px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.thumb .chip-cat {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,.55); color: var(--gold-light);
  font-size: 10.5px; letter-spacing: .1em;
  padding: 2px 10px; border-radius: 999px;
  border: 1px solid rgba(185,167,103,.6);
}
.thumb .chip-time {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.65); color: #fff;
  font-size: 11px; padding: 1px 8px; border-radius: 4px;
}
.vcard.locked .thumb .play { background: rgba(90, 85, 70, .85); }
.vcard.locked .thumb .play::after {
  border: none; margin: 0;
  width: 16px; height: 14px;
  background:
    linear-gradient(#fff, #fff) 50% 100%/16px 9px no-repeat,
    radial-gradient(circle at 50% 42%, transparent 3.4px, #fff 3.5px, #fff 5.4px, transparent 5.5px) 50% 0/16px 12px no-repeat;
}
.lock-note {
  position: absolute; inset: auto 0 0 0;
  background: rgba(0,0,0,.6); color: var(--gold-light);
  font-size: 11px; text-align: center; padding: 3px 0; letter-spacing: .1em;
}
.vbody { padding: 14px 16px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vtitle { font-size: 14.5px; font-weight: 700; line-height: 1.55; }
.vmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.chip {
  font-size: 10.5px; letter-spacing: .06em;
  padding: 1px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--gray);
  background: var(--cream);
}
.chip.gold { border-color: var(--gold); color: var(--gold-dark); background: var(--gold-pale); }
.chip.done { border-color: var(--ok); color: var(--ok); background: #EFF5EF; }
.pbar { height: 4px; background: var(--gold-pale); border-radius: 2px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--gold); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: var(--white); color: var(--gold-dark);
  font-size: 13.5px; font-weight: 700; letter-spacing: .08em;
  transition: background .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--gold-pale); }
.btn-primary {
  background: linear-gradient(135deg, #C6B57C, var(--gold-dark));
  color: #fff; border: none;
  box-shadow: 0 3px 12px rgba(156, 138, 79, .35);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, #C6B57C, var(--gold-dark)); }
.btn-dark { background: var(--black); color: var(--gold-light); border-color: var(--black); }
.btn-dark:hover { background: #33312A; }
.btn-ghost { border-color: var(--line); color: var(--gray); }
.btn-ghost:hover { background: var(--cream); }
.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #F8EDEB; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- フォーム ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12px; color: var(--gray);
  letter-spacing: .07em; margin-bottom: 6px; font-weight: 500;
}
.field label .req {
  color: var(--danger); font-size: 10px; margin-left: 6px;
  border: 1px solid var(--danger); border-radius: 3px; padding: 0 4px;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #D9D3C0;
  border-radius: 8px;
  padding: 10px 13px;
  font: inherit; color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 167, 103, .18);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-pill span {
  display: inline-block; padding: 6px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; color: var(--gray);
  transition: all .15s;
}
.radio-pill input:checked + span {
  border-color: var(--gold); background: var(--gold-pale);
  color: var(--gold-dark); font-weight: 700;
}

/* ---------- テーブル ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; color: var(--gray);
  letter-spacing: .08em; font-weight: 500;
  padding: 9px 12px; border-bottom: 2px solid var(--gold-light);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: #FBFAF4; }

/* ---------- ステータスチップ ---------- */
.st {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; padding: 2px 11px; border-radius: 999px; white-space: nowrap;
}
.st-received, .st-open { border: 1px solid var(--gold); color: var(--gold-dark); }
.st-reviewing { background: var(--gold-pale); color: var(--gold-dark); border: 1px solid var(--gold); }
.st-feedback { background: var(--gold); color: #fff; }
.st-closed { background: #EEECE4; color: var(--gray); }

/* ---------- プレイヤー ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gray); font-size: 13px; margin-bottom: 16px;
}
.back-link:hover { color: var(--gold-dark); }
.player-wrap {
  background: #000; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.player-wrap video { width: 100%; display: block; max-height: 62vh; background: #000; }
.player-note {
  background: var(--cream); border: 1px dashed var(--gold);
  color: var(--gold-dark); border-radius: 8px;
  padding: 12px 16px; font-size: 13px; margin-top: 12px;
}
.video-head { margin: 20px 0 6px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.video-title { font-size: 19px; font-weight: 700; line-height: 1.5; }
.video-desc { color: var(--gray); font-size: 13.5px; margin-top: 6px; max-width: 720px; }
.video-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.material-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 10px; background: var(--white);
  transition: border-color .15s;
}
.material-item:hover { border-color: var(--gold); }
.material-item .m-icon {
  width: 38px; height: 38px; flex: none; border-radius: 8px;
  background: var(--gold-pale);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark); font-size: 10px; font-weight: 700; letter-spacing: .05em;
}
.material-item .m-title { flex: 1; font-size: 13.5px; font-weight: 500; }

/* ---------- FBスレッド ---------- */
.thread { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.msg { max-width: 88%; }
.msg .msg-meta { font-size: 11px; color: var(--gray-light); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.msg .msg-body {
  border-radius: 12px; padding: 13px 17px;
  font-size: 13.5px; white-space: pre-wrap; line-height: 1.8;
}
.msg-report { align-self: flex-start; }
.msg-report .msg-body { background: var(--white); border: 1px solid var(--line); border-top-left-radius: 3px; }
.msg-fb { align-self: flex-end; }
.msg-fb .msg-body {
  background: var(--cream);
  border: 1px solid var(--gold-light);
  border-left: 3px solid var(--gold);
  border-top-right-radius: 3px;
}
.fb-badge {
  background: var(--gold); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  padding: 1px 8px; border-radius: 999px;
}

/* ---------- モーダル ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(24, 22, 14, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadein .18s ease;
}
.modal {
  background: var(--white); border-radius: 14px;
  max-width: 580px; width: 100%; max-height: 86vh; overflow-y: auto;
  padding: 28px 30px;
  box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--gold);
}
.modal h3 { font-size: 17px; letter-spacing: .06em; margin-bottom: 4px; }
.modal .modal-en { font-family: var(--serif); font-size: 10px; letter-spacing: .3em; color: var(--gold); }
.quiz-q { margin: 18px 0 8px; font-weight: 700; font-size: 14px; }
.quiz-choice { display: block; margin-bottom: 8px; position: relative; }
.quiz-choice input { position: absolute; opacity: 0; }
.quiz-choice span {
  display: block; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; cursor: pointer; transition: all .15s;
}
.quiz-choice input:checked + span {
  border-color: var(--gold); background: var(--gold-pale); font-weight: 700;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.quiz-result { text-align: center; padding: 18px 0 6px; }
.quiz-result .qr-mark { font-family: var(--serif); font-size: 42px; color: var(--gold); line-height: 1.3; }
.quiz-result .qr-mark.fail { color: var(--gray-light); }

/* ---------- トースト ---------- */
#toast-root { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--black); color: #F2EFE6;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 10px 26px;
  font-size: 13px; letter-spacing: .05em;
  box-shadow: var(--shadow-lg);
  animation: toastin .25s ease;
  white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.error { border-color: var(--danger); color: #F5D9D4; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadein { from { opacity: 0; } }

/* ---------- スケルトンローディング ---------- */
.skel {
  display: block; border-radius: 8px;
  background: linear-gradient(100deg, var(--gold-pale) 40%, #FBF9F1 50%, var(--gold-pale) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skel-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.skel-card { height: 180px; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 昇格プログレス ---------- */
.promo-card {
  background: var(--white);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  padding: 18px 22px 15px;
  margin-top: 14px;
}
.promo-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; margin-bottom: 10px; gap: 10px; flex-wrap: wrap;
}
.promo-next {
  font-family: var(--serif); font-size: 21px; color: var(--gold-dark);
  margin: 0 2px; line-height: 1;
}
.pbar-lg { height: 10px; border-radius: 5px; }
.pbar-lg i { background: linear-gradient(to right, var(--gold-light), var(--gold)); transition: width .5s ease; }
.promo-note { font-size: 11px; color: var(--gray-light); margin-top: 8px; }
.promo-max {
  display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(135deg, #FBF9F1, var(--gold-pale));
}
.promo-max b { color: var(--gold-dark); letter-spacing: .06em; }
.promo-max span { font-size: 12px; color: var(--gray); }

/* ---------- 再生速度 ---------- */
.speed-ctl {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto; align-self: center;
  font-size: 12px; color: var(--gray);
}
.speed-ctl select {
  font: inherit; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--text);
}

/* ---------- フィルタ件数 ---------- */
.pill-count {
  font-size: 10px; margin-left: 6px;
  color: var(--gray-light); font-weight: 400;
}
.radio-pill input:checked + span .pill-count { color: var(--gold-dark); }

/* ---------- 空状態 ---------- */
.empty {
  text-align: center; color: var(--gray-light);
  padding: 44px 0; font-size: 13px;
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ---------- 統計バー（管理） ---------- */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 12.5px; }
.bar-row .bar-label { width: 40%; min-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .bar-track { flex: 1; height: 10px; background: var(--gold-pale); border-radius: 5px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: linear-gradient(to right, var(--gold-light), var(--gold)); }
.bar-row .bar-num { width: 70px; text-align: right; color: var(--gray); font-size: 11.5px; white-space: nowrap; }

/* ---------- ボトムナビ（モバイル） ---------- */
.bottomnav {
  display: none;
  position: fixed; inset: auto 0 0 0; z-index: 50;
  background: var(--black);
  border-top: 2px solid var(--gold);
  padding: 5px 0 max(5px, env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--gray-light); font-size: 9.5px; letter-spacing: .04em;
  padding: 4px 0;
}
.bottomnav a svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav a svg .fill { fill: currentColor; stroke: none; }
.bottomnav a.active { color: var(--gold); }

/* ---------- 学習ロードマップ ---------- */
.rm-wrap { position: relative; padding-left: 26px; }
.rm-wrap::before {
  content: ""; position: absolute; left: 7px; top: 14px; bottom: 30px;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), var(--gold-light) 70%, transparent);
}
.rm-tier { position: relative; margin-bottom: 22px; }
.rm-dot {
  position: absolute; left: -26px; top: 18px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 3px var(--white);
}
.rm-tier.is-done .rm-dot { background: var(--gold); }
.rm-tier.is-locked .rm-dot { border-color: var(--gray-light); }
.rm-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  animation: fadeup .34s ease backwards;
}
.rm-tier.is-current .rm-card { border-color: var(--gold); box-shadow: var(--shadow); }
.rm-tier.is-locked .rm-card { opacity: .62; }
.rm-tier-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rm-tier-title { font-size: 15.5px; font-weight: 700; letter-spacing: .05em; }
.rm-tier-period {
  font-family: var(--serif); font-size: 12px; color: var(--gold-dark);
  letter-spacing: .1em; margin-top: 2px;
}
.rm-state {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  padding: 3px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--gold); color: #fff;
}
.rm-tier.is-done .rm-state { background: transparent; color: var(--ok); border: 1px solid var(--ok); }
.rm-tier.is-locked .rm-state { background: #EEECE4; color: var(--gray); }
.rm-tier.is-next .rm-state {
  background: transparent; color: var(--gold-dark); border: 1px solid var(--gold);
}
.rm-tier.is-next .rm-dot { border-color: var(--gold-light); }
.rm-tier-desc { font-size: 12.5px; color: var(--gray); margin: 6px 0 12px; }
.rm-item { border-top: 1px solid var(--line); padding: 11px 0 10px; }
.rm-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rm-item-title { font-size: 13.5px; font-weight: 500; }
a.rm-item-title:hover { color: var(--gold-dark); text-decoration: underline; }
.rm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.signed { border-color: var(--gold-dark); background: var(--gold); color: #fff; }
.rm-signoff {
  margin-top: 9px;
  background: var(--cream);
  border: 1px solid var(--gold-light);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
}
.rm-signoff b { margin: 0 6px 0 8px; }
.rm-signoff-date { color: var(--gray-light); font-size: 11px; }
.rm-signoff p { margin-top: 4px; color: var(--text); white-space: pre-wrap; }
.rm-goal .rm-card { background: linear-gradient(135deg, #FBF9F1, var(--gold-pale)); }

/* ---------- 施術申告書 ---------- */
.skill-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  margin-bottom: 12px;
  overflow: hidden;
}
.skill-step summary {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  cursor: pointer; list-style: none;
  background: var(--cream);
  transition: background .15s;
}
.skill-step summary::-webkit-details-marker { display: none; }
.skill-step summary::before {
  content: ""; width: 8px; height: 8px; flex: none;
  border-right: 2px solid var(--gold-dark); border-bottom: 2px solid var(--gold-dark);
  transform: rotate(-45deg); transition: transform .18s;
}
.skill-step[open] summary::before { transform: rotate(45deg); }
.skill-step summary:hover { background: var(--gold-pale); }
.ss-title { font-family: var(--serif); font-weight: 600; letter-spacing: .12em; color: var(--black); }
.ss-meta { font-size: 12px; color: var(--gray); white-space: nowrap; }
.ss-meta b { color: var(--gold-dark); }
.ss-bar { flex: 1; max-width: 220px; height: 6px; }
.sk-table th.sk-th { text-align: center; white-space: nowrap; }
.sk-cat { font-size: 12px; color: var(--gray); white-space: nowrap; }
.sk-detail {
  font-size: 11px; color: var(--gold-dark);
  background: var(--gold-pale); border-radius: 4px;
  padding: 1px 7px; margin-left: 6px; white-space: nowrap;
}
.sk-cell { text-align: center; }
.sk-cell input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer;
}
.sk-mark { color: var(--gold-dark); font-weight: 700; }
.sk-empty { color: #DDD8C9; }

/* ---------- Googleフォーム表示 ---------- */
.form-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  background: var(--cream);
  border: 1px solid var(--gold-light);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
}
.form-cta-title { font-size: 15px; font-weight: 700; letter-spacing: .05em; }
.form-cta-note { font-size: 12px; color: var(--gray); margin-top: 3px; }
.form-embed {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}
.form-embed iframe { display: block; width: 100%; height: 78vh; min-height: 520px; border: 0; }
.legacy-box {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.legacy-box summary {
  padding: 12px 18px; cursor: pointer;
  font-size: 12.5px; color: var(--gray);
  background: var(--cream);
}
.legacy-box[open] summary { border-bottom: 1px solid var(--line); }

/* ---------- 症例写真 ---------- */
.photo-warn {
  background: #FBF4F2;
  border: 1px solid #E8CFC9;
  color: #8C4034;
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 11.5px; line-height: 1.75;
  margin-bottom: 10px;
}
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.photo-item { position: relative; }
.photo-item img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 9px; border: 1px solid var(--line);
  cursor: zoom-in; display: block;
  transition: border-color .15s, transform .15s;
  background: var(--cream);
}
.photo-item img:hover { border-color: var(--gold); transform: scale(1.015); }
.photo-item figcaption {
  display: flex; flex-direction: column; gap: 1px;
  font-size: 11.5px; margin-top: 5px; line-height: 1.5;
}
.photo-meta { color: var(--gray-light); font-size: 10.5px; }
.photo-del {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(28, 27, 23, .62); color: #fff;
  font-size: 15px; line-height: 1; opacity: 0; transition: opacity .15s;
}
.photo-item:hover .photo-del, .photo-del:focus-visible { opacity: 1; }
.photo-del:hover { background: var(--danger); }
.photo-none { color: var(--gray-light); font-size: 13px; grid-column: 1/-1; padding: 6px 0; }
.photo-add { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.photo-add-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo-add-row input[type="text"] {
  flex: 1; min-width: 200px;
  border: 1px solid #D9D3C0; border-radius: 8px;
  padding: 8px 12px; font: inherit;
}
.photo-add-row label { cursor: pointer; }
.photo-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.photo-chip {
  font-size: 11px; background: var(--gold-pale); color: var(--gold-dark);
  border-radius: 999px; padding: 2px 11px;
}
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(18, 17, 12, .9);
  display: flex; align-items: center; justify-content: center;
  padding: 26px; cursor: zoom-out;
  animation: fadein .18s ease;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  background: none; border: none; color: #fff; font-size: 34px; line-height: 1;
}

/* ---------- 進捗一覧 ---------- */
.pg-pct { color: var(--gray-light); font-size: 12.5px; }
.pg-pct.part { color: var(--gold-dark); font-weight: 700; }
.pg-pct.full { color: var(--ok); font-weight: 700; }
.pg-row:hover td { background: var(--gold-pale); }

/* ---------- ページ遷移のフェード & アクセシビリティ ---------- */
.page-head, .stat, .card, .vcard, .material-item, .promo-card { animation: fadeup .34s ease backwards; }
.stat:nth-child(2), .vcard:nth-child(2) { animation-delay: .04s; }
.stat:nth-child(3), .vcard:nth-child(3) { animation-delay: .08s; }
.stat:nth-child(4), .vcard:nth-child(4) { animation-delay: .12s; }
@keyframes fadeup { from { opacity: 0; transform: translateY(7px); } }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 900px) {
  .sidenav { display: none; }
  .bottomnav { display: flex; }
  .main { margin-left: 0; padding: 22px 16px 96px; }
  .brand-ja { font-size: 13px; white-space: nowrap; }
  .brand-en { display: none; }
  .site-header { padding: 0 14px; }
  .user-name { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .page-title { font-size: 19px; }
  .msg { max-width: 100%; }
  .material-item { flex-wrap: wrap; }
  .material-item .m-title { flex: 1 1 calc(100% - 52px); }
  .material-item .btn { flex: 1; }
}
