/* ============================================================
   screenplay.css — 事例デモ v2「スクリーンプレイ」+ 開発体制セクション
   (2026-07-06 全面刷新)

   考え方:
   - 抽象モックをやめ、実プロダクトと同じ画面構成をHTMLで高密度に再現する
   - 墨背景の「窓枠」に額装して、紫×墨の世界観と実物提示を両立させる (Raycast型)
   - 演出はスクロール進入時に1回再生 → 完成形で静止 → 可視中はフェードを
     挟んで個別尺でリプレイ (巻き戻りの白紙ノイズを出さない)
   - ラベルで誠実に区別する: 「実物UIを再現」(本番プロダクトあり) /
     「画面イメージ」(実案件を再構成)
   ============================================================ */

/* ---------- 窓枠 (額装) ---------- */
.sp-demo { margin: 0 0 var(--s-28); }

.sp-window {
  background: #17171d;
  border: 1px solid #26262e;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(15, 15, 20, 0.45);
}
.sp-window-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #1d1d24;
  border-bottom: 1px solid #26262e;
}
.sp-dots { display: flex; gap: 6px; flex-shrink: 0; }
.sp-dots span { width: 10px; height: 10px; border-radius: 50%; background: #3a3a44; }
.sp-dots span:nth-child(1) { background: #ff5f57; }
.sp-dots span:nth-child(2) { background: #febc2e; }
.sp-dots span:nth-child(3) { background: #28c840; }
.sp-window-title {
  font-family: var(--font-jp);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #b9b9c3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-window-tag {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
}
.sp-window-tag.is-real { background: rgba(167, 139, 250, 0.18); color: #c4b0f8; }
.sp-window-tag.is-image { background: rgba(255, 255, 255, 0.08); color: #9a9aa6; }

.sp-screen {
  position: relative;
  background: #f6f7f9;
  min-height: 300px;
  font-family: var(--font-jp);
}

/* リプレイのフェード (巻き戻りの白紙を見せない) */
.sp-screen-inner { transition: opacity 0.24s ease; }
.sp-demo.is-resetting .sp-screen-inner { opacity: 0; }

/* 成果スタンプ (画面右下に押される) */
.sp-stamp {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 2px;
  box-shadow: 0 8px 20px -8px rgba(76, 29, 149, 0.7);
  opacity: 0;
  transform: scale(1.25) rotate(-3deg);
}
.sp-stamp strong { font-size: 14px; }
.is-active .sp-stamp { animation: spStamp 0.35s var(--sp-stamp-delay, 5s) forwards; }
@keyframes spStamp {
  60% { opacity: 1; transform: scale(0.96) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-2deg); }
}

/* リプレイボタン */
.sp-replay {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 6px 10px;
  opacity: 0;
  transition: opacity 0.3s ease, color 0.15s ease, border-color 0.15s ease;
}
.sp-replay::before { content: '↻'; font-size: 13px; line-height: 1; }
.sp-demo.is-played .sp-replay { opacity: 1; }
.sp-replay:hover { color: var(--brand); border-color: var(--brand); }

/* 共通パーツ */
.sp-cursor-caret { border-right: 2px solid var(--brand); }
@keyframes spCaret { 50% { border-right-color: transparent; } }
@keyframes spFadeIn { to { opacity: 1; } }
@keyframes spRise { to { opacity: 1; transform: translateY(0); } }
@keyframes spSlideR { to { opacity: 1; transform: translateX(0); } }
@keyframes spType { to { width: 100%; } }
@keyframes spScan { 0% { top: 0; opacity: 1; } 92% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes spProgress { to { transform: scaleX(1); } }
@keyframes spPop {
  0% { opacity: 0; transform: scale(0.8); }
  70% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes spPulse { 0% { opacity: 0.7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes spWave { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@keyframes spDot { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px); } }
@keyframes spBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============================================================
   アプリ再現UIの共通シェル: サイドバー付きSaaS画面
   ============================================================ */
.sp-app { display: grid; grid-template-columns: 148px 1fr; min-height: 300px; }
.sp-app-nav {
  background: #fff;
  border-right: 1px solid #e8e8ec;
  padding: 12px 0 52px; /* 下端は「もう一度見る」ボタンの居場所 */
  display: flex;
  flex-direction: column;
}
.sp-app-logo {
  font-size: 12px;
  font-weight: 900;
  padding: 4px 14px 12px;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #f0f0f3;
  margin-bottom: 8px;
}
.sp-app-navlabel { font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; color: #a2a2ad; padding: 8px 14px 4px; }
.sp-app-navitem {
  font-size: 10.5px;
  font-weight: 500;
  color: #5a5a66;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
}
.sp-app-navitem::before { content: ''; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; opacity: 0.55; flex-shrink: 0; }
.sp-app-navitem.is-current { font-weight: 700; }
.sp-app-main { padding: 14px 16px; position: relative; min-width: 0; }
.sp-app-title { font-size: 13px; font-weight: 900; color: var(--ink); margin-bottom: 10px; }

/* ============================================================
   01 保険 — 証券読解AI (実物: 緑基調) の再現
   ============================================================ */
.sp-hoken { --app: #0e7a4e; --app-soft: #e9f5ef; }
.sp-hoken .sp-app-logo { color: var(--app); }
.sp-hoken .sp-app-navitem.is-current { color: var(--app); background: var(--app-soft); box-shadow: inset 2px 0 0 var(--app); }

.sp-hoken-stage { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: start; }

/* 証券PDFカード: ドロップイン → スキャン */
.sp-hoken-pdf {
  background: #fff;
  border: 1px solid #dcdce2;
  border-radius: 3px;
  padding: 10px 9px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  opacity: 0;
  transform: translateY(-14px);
  box-shadow: 0 6px 16px -8px rgba(15, 15, 20, 0.25);
}
.is-active .sp-hoken-pdf { animation: spRise 0.45s 0.1s var(--ease-out) forwards; }
.sp-hoken-pdf-head { font-size: 8px; font-weight: 900; letter-spacing: 0.12em; color: #5a5a66; display: flex; justify-content: space-between; margin-bottom: 7px; }
.sp-hoken-pdf-head::after { content: 'PDF'; color: #c0392b; font-weight: 900; }
.sp-hoken-pdf .l { height: 4px; background: #e4e4e9; border-radius: 1px; margin: 5px 0; }
.sp-hoken-pdf .l.hl { background: #efe6c8; position: relative; }
.sp-hoken-pdf .l.hl::after {
  content: '';
  position: absolute; inset: -2px -2px;
  border: 1px solid var(--app);
  border-radius: 2px;
  opacity: 0;
}
.is-active .sp-hoken-pdf .l.hl:nth-of-type(3)::after { animation: spFadeIn 0.2s 1.15s forwards; }
.is-active .sp-hoken-pdf .l.hl:nth-of-type(6)::after { animation: spFadeIn 0.2s 1.5s forwards; }
.is-active .sp-hoken-pdf .l.hl:nth-of-type(9)::after { animation: spFadeIn 0.2s 1.85s forwards; }
.sp-hoken-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--app);
  box-shadow: 0 0 10px var(--app);
  opacity: 0;
}
.is-active .sp-hoken-scan { animation: spScan 1.5s 0.7s forwards; }

/* 解析プログレス → 結果パネル */
.sp-hoken-out { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-hoken-progress { font-size: 9.5px; color: #5a5a66; opacity: 0; }
.is-active .sp-hoken-progress { animation: spFadeIn 0.2s 0.7s forwards, spFadeOut-keep 0.2s 2.5s forwards; }
@keyframes spFadeOut-keep { to { opacity: 0; height: 0; margin: 0; overflow: hidden; } }
.sp-hoken-progress .bar { height: 3px; background: #e4e4e9; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.sp-hoken-progress .bar i { display: block; height: 100%; background: var(--app); transform: scaleX(0); transform-origin: left; }
.is-active .sp-hoken-progress .bar i { animation: spProgress 1.7s 0.75s linear forwards; }

.sp-hoken-card {
  background: #fff;
  border: 1px solid #e2e2e8;
  border-radius: 4px;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(8px);
}
.is-active .sp-hoken-card { animation: spRise 0.35s 2.55s var(--ease-out) forwards; }
.sp-hoken-card-tag { display: inline-block; font-size: 8.5px; font-weight: 700; color: var(--app); background: var(--app-soft); padding: 2px 7px; border-radius: 2px; margin-bottom: 6px; }
.sp-hoken-card-name { font-size: 11.5px; font-weight: 900; color: var(--ink); margin-bottom: 2px; }
.sp-hoken-card-sub { font-size: 9px; color: #8a8a94; }

.sp-hoken-rows { display: flex; flex-direction: column; gap: 4px; }
.sp-hoken-row {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff;
  border: 1px solid #e9e9ee;
  border-left: 2px solid var(--app);
  border-radius: 2px;
  padding: 5px 10px;
  font-size: 10px;
  opacity: 0;
  transform: translateX(-8px);
}
.is-active .sp-hoken-row:nth-child(1) { animation: spSlideR 0.3s 3.0s forwards; }
.is-active .sp-hoken-row:nth-child(2) { animation: spSlideR 0.3s 3.2s forwards; }
.is-active .sp-hoken-row:nth-child(3) { animation: spSlideR 0.3s 3.4s forwards; }
.is-active .sp-hoken-row:nth-child(4) { animation: spSlideR 0.3s 3.6s forwards; }
.sp-hoken-row .k { color: #74747e; }
.sp-hoken-row .v { font-weight: 900; color: var(--ink); }
.sp-hoken-alert {
  display: flex; align-items: center; gap: 6px;
  background: #fdf3e7;
  border: 1px solid #eeb864;
  border-radius: 2px;
  color: #8a5a10;
  font-size: 10px;
  font-weight: 700;
  padding: 7px 10px;
  opacity: 0;
  transform: scale(0.9);
}
.is-active .sp-hoken-alert { animation: spPop 0.35s 4.2s forwards; }
.sp-hoken { --sp-stamp-delay: 4.9s; }

/* ============================================================
   02 不動産 — 書式ドラフト生成 (画面イメージ)
   ============================================================ */
.sp-fudosan { --app: #4c1d95; }
/* 左下の「もう一度見る」ボタンと生成ボタンが重ならないよう下に余白を確保 */
.sp-fudosan-stage { display: grid; grid-template-columns: 168px 1fr; gap: 14px; padding: 14px 16px 56px; align-items: start; }
.sp-fudosan-form { display: flex; flex-direction: column; gap: 7px; }
.sp-fudosan-form-title { font-size: 10px; font-weight: 900; color: var(--ink); margin-bottom: 2px; }
.sp-fudosan-field { background: #fff; border: 1px solid #dcdce2; border-radius: 3px; padding: 5px 8px; }
.sp-fudosan-field .k { display: block; font-size: 8px; color: #a2a2ad; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 1px; }
.sp-fudosan-field .v {
  display: inline-block;
  font-size: 10px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden;
  width: 0;
  vertical-align: bottom;
}
.is-active .sp-fudosan-field:nth-child(2) .v { animation: spType 0.5s 0.3s steps(14) forwards, spCaretB 0.4s 0.3s 2; }
.is-active .sp-fudosan-field:nth-child(3) .v { animation: spType 0.4s 1.0s steps(8) forwards, spCaretB 0.4s 1.0s 2; }
.is-active .sp-fudosan-field:nth-child(4) .v { animation: spType 0.4s 1.6s steps(8) forwards, spCaretB 0.4s 1.6s 2; }
.is-active .sp-fudosan-field:nth-child(5) .v { animation: spType 0.4s 2.2s steps(8) forwards, spCaretB 0.4s 2.2s 2; }
@keyframes spCaretB { 0%, 100% { box-shadow: none; } 50% { box-shadow: 2px 0 0 var(--brand); } }
.sp-fudosan-gen {
  margin-top: 3px;
  text-align: center;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border-radius: 3px;
  padding: 7px 8px;
  opacity: 0.35;
}
.is-active .sp-fudosan-gen { animation: spBlink 0.5s 2.9s 2, spFadeIn 0.2s 2.9s forwards; }

/* A4書類が組版されていく */
.sp-fudosan-doc {
  background: #fff;
  border: 1px solid #dcdce2;
  border-radius: 2px;
  padding: 14px 16px 26px;
  font-family: var(--font-serif);
  color: var(--ink-2);
  font-size: 9.5px;
  line-height: 1.75;
  position: relative;
  min-height: 250px;
  box-shadow: 0 10px 24px -14px rgba(15, 15, 20, 0.3);
}
.sp-fudosan-doc-title { text-align: center; font-weight: 900; font-size: 11.5px; letter-spacing: 0.2em; color: var(--ink); margin-bottom: 3px; opacity: 0; }
.is-active .sp-fudosan-doc-title { animation: spFadeIn 0.3s 3.4s forwards; }
.sp-fudosan-doc-sub { text-align: center; font-size: 7.5px; color: #a2a2ad; margin-bottom: 10px; opacity: 0; }
.is-active .sp-fudosan-doc-sub { animation: spFadeIn 0.3s 3.55s forwards; }
.sp-fudosan-doc table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.sp-fudosan-doc td {
  border: 1px solid #d8d8de;
  padding: 3px 7px;
  font-size: 8.5px;
  opacity: 0;
}
.sp-fudosan-doc td.h { background: #f3f2ee; font-weight: 700; width: 34%; white-space: nowrap; }
.is-active .sp-fudosan-doc tr:nth-child(1) td { animation: spFadeIn 0.25s 3.7s forwards; }
.is-active .sp-fudosan-doc tr:nth-child(2) td { animation: spFadeIn 0.25s 3.95s forwards; }
.is-active .sp-fudosan-doc tr:nth-child(3) td { animation: spFadeIn 0.25s 4.2s forwards; }
.sp-fudosan-clause { white-space: nowrap; overflow: hidden; width: 0; }
.is-active .sp-fudosan-clause.c1 { animation: spType 0.7s 4.5s forwards; }
.is-active .sp-fudosan-clause.c2 { animation: spType 0.7s 5.3s forwards; }
.sp-fudosan-check {
  position: absolute;
  left: 16px; bottom: 8px;
  font-family: var(--font-jp);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #ddd0f5;
  border-radius: 2px;
  padding: 3px 8px;
  opacity: 0;
}
.is-active .sp-fudosan-check { animation: spFadeIn 0.3s 6.1s forwards; }
.sp-fudosan { --sp-stamp-delay: 6.5s; }

/* ============================================================
   スマホ額装シェル (03 コミュニティ運営 で使用)
   ============================================================ */
.sp-phone-shell { display: flex; justify-content: center; padding: 18px 16px; background: linear-gradient(160deg, #ece9f4, #f6f7f9); }
.sp-phone {
  width: 232px;
  background: #fff;
  border: 6px solid #1d1d24;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 36px -18px rgba(15, 15, 20, 0.5);
}
.sp-phone-status {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 8px; font-weight: 700; color: var(--ink);
  padding: 5px 12px 3px;
}
.sp-phone-status::after { content: '●●●'; font-size: 5px; letter-spacing: 1px; color: #c9c9d0; }

/* ============================================================
   03 コミュニティ運営 — 会員ポータル「今日の席」(会員限定サイトの再現)
   実UIの配色をそのまま踏襲: 濃紺 #17184b / 角丸ほぼ直角 2px。
   氏名・会社名はサンプル (実データは会員限定・個人情報のため使わない)。
   ============================================================ */
.sp-shusei { --app: #17184b; --app-soft: #f2f3f8; --sp-stamp-delay: 6.2s; }
.sp-shusei-body { padding: 8px 11px 14px; background: #fafafa; min-height: 268px; }
.sp-shusei-label { font-size: 8.5px; font-weight: 900; letter-spacing: 0.1em; color: var(--app); }
.sp-shusei-name { font-size: 13px; font-weight: 900; color: #172033; margin: 2px 0 9px; }

.sp-shusei-event {
  position: relative;
  background: #fff;
  border: 1px solid #e2e5eb;
  border-radius: 2px;
  padding: 8px 10px;
  margin-bottom: 9px;
  opacity: 0;
  transform: translateY(-8px);
}
.is-active .sp-shusei-event { animation: spRise 0.4s 0.2s var(--ease-out) forwards; }
.sp-shusei-event .e-t { font-size: 10.5px; font-weight: 900; color: #172033; }
.sp-shusei-event .e-d { font-size: 8.5px; color: #697386; margin-top: 2px; }
.sp-shusei-event .e-badge {
  position: absolute; right: 9px; top: 9px;
  font-size: 8px; font-weight: 900;
  color: var(--app); background: var(--app-soft);
  border: 1px solid rgba(23, 24, 75, 0.16);
  border-radius: 999px; padding: 2px 7px;
}

.sp-shusei-rot { font-size: 9px; color: #697386; margin-bottom: 7px; opacity: 0; }
.sp-shusei-rot strong { color: #172033; font-weight: 900; }
.is-active .sp-shusei-rot { animation: spFadeIn 0.3s 0.9s forwards; }

.sp-shusei-peers { display: flex; flex-direction: column; gap: 6px; }
.sp-shusei-peer {
  background: #fff;
  border: 1px solid #e2e5eb;
  border-radius: 2px;
  padding: 7px 9px;
  opacity: 0;
  transform: translateX(-8px);
}
.is-active .sp-shusei-peer:nth-child(1) { animation: spSlideR 0.35s 1.4s forwards; }
.is-active .sp-shusei-peer:nth-child(2) { animation: spSlideR 0.35s 1.8s forwards; }
.is-active .sp-shusei-peer:nth-child(3) { animation: spSlideR 0.35s 2.2s forwards; }
.sp-shusei-peer .p-top { display: flex; align-items: center; gap: 6px; }
.sp-shusei-peer .p-name { font-size: 10.5px; font-weight: 900; color: #172033; }
.sp-shusei-peer .p-tag {
  font-size: 7.5px; font-weight: 900;
  color: var(--app); background: var(--app-soft);
  border-radius: 999px; padding: 2px 6px;
}
.sp-shusei-peer .p-co { font-size: 8.5px; color: #697386; margin-top: 1px; }
/* AIが出す「会話のきっかけ」。この製品の肝なので、一拍おいて浮かび上がらせる */
.sp-shusei-peer .p-hook {
  font-size: 9px; line-height: 1.55; font-weight: 700; color: #172033;
  margin-top: 5px; padding-left: 7px;
  border-left: 2px solid var(--app);
  opacity: 0;
}
.is-active .sp-shusei-peer:nth-child(1) .p-hook { animation: spFadeIn 0.35s 2.9s forwards; }
.is-active .sp-shusei-peer:nth-child(2) .p-hook { animation: spFadeIn 0.35s 3.3s forwards; }
.is-active .sp-shusei-peer:nth-child(3) .p-hook { animation: spFadeIn 0.35s 3.7s forwards; }

.sp-shusei-note {
  font-size: 8px; line-height: 1.5; color: #697386;
  background: var(--app-soft);
  border-radius: 2px;
  padding: 6px 8px;
  margin-top: 8px;
  opacity: 0;
}
.is-active .sp-shusei-note { animation: spFadeIn 0.35s 4.4s forwards; }

/* ============================================================
   06 スクール — 運営ダッシュボード (実物再現)
   ============================================================ */
.sp-school { --app: #16803c; --app-soft: #e9f5ee; }
.sp-school .sp-app-logo { color: var(--ink); }
.sp-school .sp-app-navitem.is-current { color: var(--app); background: var(--app-soft); box-shadow: inset 2px 0 0 var(--app); }

.sp-school-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sp-school-btn {
  font-size: 9.5px; font-weight: 900; color: #fff; background: var(--app);
  border-radius: 3px; padding: 6px 12px;
  display: inline-flex; align-items: center; gap: 5px;
}
.sp-school-btn::before { content: '+'; font-weight: 900; }
.is-active .sp-school-btn { animation: spBlink 0.5s 0.4s 2; }

.sp-school-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 10px; }
.sp-school-stat { background: #fff; border: 1px solid #e5e5ea; border-radius: 4px; padding: 7px 9px; }
.sp-school-stat .k { font-size: 7.5px; color: #8a8a94; font-weight: 700; display: block; margin-bottom: 2px; }
.sp-school-stat .v { font-size: 13px; font-weight: 900; color: var(--ink); }
.sp-school-stat .v small { font-size: 8px; color: #8a8a94; font-weight: 700; }

/* コースカード出現 → 公開トグル → 決済通知 */
.sp-school-course {
  background: #fff; border: 1px solid #e5e5ea; border-radius: 5px;
  padding: 9px 11px;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(8px);
}
.is-active .sp-school-course { animation: spRise 0.4s 1.2s var(--ease-out) forwards; }
.sp-school-course-thumb { width: 44px; height: 30px; border-radius: 3px; background: linear-gradient(135deg, #ddd3f6, #b9a2ee); flex-shrink: 0; }
.sp-school-course-info { flex: 1; min-width: 0; }
.sp-school-course-info .t { font-size: 10px; font-weight: 900; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-school-course-info .m { font-size: 8px; color: #8a8a94; margin-top: 1px; }
.sp-school-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 8px; font-weight: 700; color: #8a8a94; flex-shrink: 0; }
.sp-school-toggle .sw { width: 26px; height: 14px; border-radius: 7px; background: #d3d3da; position: relative; transition: background 0.25s; }
.sp-school-toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: left 0.25s; }
.is-active .sp-school-toggle .sw { animation: spSwitch 0.01s 2.2s forwards; }
.is-active .sp-school-toggle .sw::after { animation: spSwitchKnob 0.25s 2.2s forwards; }
@keyframes spSwitch { to { background: var(--app); } }
@keyframes spSwitchKnob { to { left: 14px; } }
.sp-school-toggle .on-label { color: var(--app); opacity: 0; }
.is-active .sp-school-toggle .on-label { animation: spFadeIn 0.2s 2.35s forwards; }

.sp-school-pay {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border: 1px solid #e2e2e8;
  border-left: 3px solid #635bff;
  border-radius: 4px;
  padding: 8px 11px;
  margin-top: 8px;
  box-shadow: 0 10px 22px -14px rgba(15, 15, 20, 0.4);
  opacity: 0;
  transform: translateY(10px);
}
.is-active .sp-school-pay { animation: spRise 0.35s 3.1s var(--ease-out) forwards; }
.sp-school-pay-icon { width: 22px; height: 22px; border-radius: 5px; background: #635bff; color: #fff; font-size: 10px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sp-school-pay .t { font-size: 9px; color: var(--ink-2); line-height: 1.45; }
.sp-school-pay .t strong { color: var(--ink); }
.sp-school-plus { font-size: 8.5px; font-weight: 900; color: var(--app); margin-top: 7px; opacity: 0; }
.is-active .sp-school-plus { animation: spFadeIn 0.3s 3.9s forwards; }
.sp-school { --sp-stamp-delay: 4.4s; }

/* ============================================================
   実画面ギャラリー格上げ (「実際の画面」ヘッダー付き)
   ============================================================ */
.case-gallery-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: var(--s-24) 0 10px;
}
.case-gallery-label::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #28c840;
  box-shadow: 0 0 0 3px rgba(40, 200, 64, 0.18);
}

/* ============================================================
   07 開発体制 (engine) セクション — 墨のライブオペレーション
   ============================================================ */
.engine {
  padding: var(--section-py) 0;
  background: #0f0f14;
  color: #e8e8ec;
  position: relative;
  overflow: hidden;
}
.engine .section-index { color: var(--brand-light); }
.engine .section-index span:last-child { color: #9a9aa6; }
.engine .section-title { color: #fff; }
.engine .section-title::after { background: var(--brand-light); }
.engine .section-lead { color: #b9b9c3; }

.engine-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: var(--s-40);
  margin-top: var(--s-60);
  align-items: start;
}
@media (max-width: 900px) { .engine-grid { grid-template-columns: 1fr; } }

/* ターミナル: 今日も動いている自動化 */
.engine-terminal {
  background: #17171d;
  border: 1px solid #26262e;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
}
.engine-terminal .sp-window-bar { background: #1d1d24; }
.engine-terminal-body {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 2.05;
  padding: 18px 20px 22px;
  min-height: 320px;
}
.engine-line { display: flex; gap: 10px; align-items: baseline; opacity: 0; transform: translateY(4px); white-space: nowrap; }
.engine-line.is-on { animation: spRise 0.3s var(--ease-out) forwards; }
.engine-line .tm { color: #6e6e7a; flex-shrink: 0; font-size: 11px; }
.engine-line .ok { color: #28c840; flex-shrink: 0; }
.engine-line .tx { color: #d5d5dd; overflow: hidden; text-overflow: ellipsis; }
.engine-line .tx em { font-style: normal; color: var(--brand-light); }
.engine-line.is-sum { border-top: 1px solid #26262e; margin-top: 10px; padding-top: 10px; }
.engine-line.is-sum .tx { color: #fff; font-weight: 700; }
.engine-caret {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--brand-light);
  vertical-align: -2px;
  animation: spBlink 1s infinite;
}

/* 数字カード */
.engine-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .engine-stats { grid-template-columns: 1fr 1fr; gap: 10px; } }
.engine-stat {
  background: #17171d;
  border: 1px solid #26262e;
  border-radius: 8px;
  padding: 22px 20px 18px;
}
.engine-stat .num {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: clamp(34px, 4vw, 44px);
  line-height: 1;
  color: #fff;
  letter-spacing: -0.01em;
}
.engine-stat .num small { font-size: 16px; color: var(--brand-light); font-weight: 900; margin-left: 2px; }
.engine-stat .lab { font-size: 12px; font-weight: 700; color: #9a9aa6; margin-top: 8px; line-height: 1.6; }

/* エージェント名簿 */
.engine-agents { margin-top: var(--s-40); }
.engine-agents-title { font-size: 13px; font-weight: 900; letter-spacing: 0.1em; color: #9a9aa6; margin-bottom: 14px; }
.engine-agents-row { display: flex; flex-wrap: wrap; gap: 8px; }
.engine-agent {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #17171d;
  border: 1px solid #26262e;
  border-radius: 999px;
  padding: 7px 14px 7px 8px;
  font-size: 12px;
  color: #d5d5dd;
}
.engine-agent i {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4c1d95, #7c4dd4);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.engine-agent b { font-weight: 700; color: #fff; }
.engine-agent span { color: #8a8a96; font-size: 11px; }

.engine-close {
  margin-top: var(--s-60);
  padding-top: var(--s-40);
  border-top: 1px solid #26262e;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-30);
  align-items: center;
}
@media (max-width: 768px) { .engine-close { grid-template-columns: 1fr; } }
.engine-close p {
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 900;
  color: #fff;
  line-height: 1.9;
  margin: 0;
}
.engine-close p .hl { color: var(--brand-light); }
.engine-close-note { font-size: var(--fs-sm); color: #9a9aa6; line-height: 1.9; margin: 10px 0 0 !important; font-weight: 500 !important; }

/* ============================================================
   06 自作ツール — 代表が自分の困りごとで作った4点
   事例セクションと同じ墨の窓枠を使うが、中身は再現UIではなく
   実物のスクリーンショット1枚。演出を付けないことで、
   主役 (事例) と視覚的に競合させない。
   ============================================================ */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-40) var(--s-30);
  margin-top: var(--s-48);
}
@media (min-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tool-card { display: flex; flex-direction: column; min-width: 0; }

.tool-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}
.tool-num {
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.tool-name {
  font-family: var(--font-jp);
  font-size: var(--fs-xl);
  font-weight: 900;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
  min-width: 0;
}
.tool-price {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 2px;
  padding: 4px 9px;
  white-space: nowrap;
}

/* 窓枠の中身は静止画1枚。縦横比を固定して4枚の見え方を揃える */
.tool-window { margin-bottom: 16px; }
.tool-shot { background: #f6f7f9; line-height: 0; }
.tool-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
/* テナオシだけ元画像が縦長。画面下端の編集バーが本題なので、下を軸に切る */
.tool-shot img.is-bottom { object-position: bottom; }

.tool-card dl { margin: 0; display: grid; gap: 10px; }
.tool-card dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 3px;
}
.tool-card dd {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.95;
  color: var(--ink-2);
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  align-self: flex-start;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--brand);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.tool-link:hover { border-bottom-color: var(--brand); }

.tools-close {
  margin: var(--s-48) 0 0;
  padding-top: var(--s-24);
  border-top: 1px solid var(--line);
  font-size: var(--fs-md);
  line-height: 2;
  color: var(--ink-2);
}
.tools-close .hl { font-weight: 900; color: var(--ink); }

/* ============================================================
   モバイル対応
   ============================================================ */
@media (max-width: 768px) {
  .sp-screen { min-height: 0; }
  .sp-app { grid-template-columns: 1fr; }
  .sp-app-nav { display: none; }
  .sp-app-main { padding-bottom: 52px; } /* 左下の「もう一度見る」の居場所 */
  .sp-hoken-stage { grid-template-columns: 88px 1fr; gap: 10px; }
  .sp-fudosan-stage { grid-template-columns: 1fr; }
  .sp-fudosan-doc { min-height: 0; }
  .sp-phone-shell { padding-bottom: 56px; }
  .sp-stamp { right: 10px; bottom: 10px; font-size: 11px; padding: 6px 10px; }
  /* 名前と価格が1行に収まらない幅では、価格を次の行へ左揃えで落とす。
     中央寄せの帯にすると仕切り線に見えてしまうため、幅は広げない。 */
  .tool-head { flex-wrap: wrap; row-gap: 8px; }
  .tool-price { margin-left: 0; order: 3; }
  .engine-terminal-body { font-size: 10.5px; padding: 14px 12px 18px; min-height: 0; }
  .engine-line { gap: 7px; }
  .engine-line .tm { font-size: 9.5px; }
}

/* reduced-motion: 全て完成形で静止表示 */
@media (prefers-reduced-motion: reduce) {
  .sp-demo * { animation: none !important; transition: none !important; }
  .sp-demo .sp-hoken-pdf, .sp-demo .sp-hoken-card, .sp-demo .sp-hoken-row, .sp-demo .sp-hoken-alert,
  .sp-demo .sp-fudosan-doc-title, .sp-demo .sp-fudosan-doc-sub, .sp-demo .sp-fudosan-doc td,
  .sp-demo .sp-fudosan-check,
  .sp-demo .sp-shusei-event, .sp-demo .sp-shusei-rot, .sp-demo .sp-shusei-peer,
  .sp-demo .sp-shusei-peer .p-hook, .sp-demo .sp-shusei-note,
  .sp-demo .sp-school-course, .sp-demo .sp-school-pay, .sp-demo .sp-school-plus, .sp-demo .sp-school-toggle .on-label,
  .sp-demo .sp-stamp, .sp-demo .sp-fudosan-gen, .sp-demo .sp-fudosan-field .v {
    opacity: 1 !important; transform: none !important; width: auto !important;
  }
  .sp-demo .sp-hoken-progress { display: none !important; }
  .engine-line { opacity: 1 !important; transform: none !important; }
}
