/* ============================================================
   PRentia Service Intro - Player
   ============================================================ */

:root {
  /* Soft, white-based palette with pink (sakura/coral) accent. */
  --color-bg: #f6f5f7;
  --color-bg-deep: #ecebee;
  --color-surface: #ffffff;
  --color-surface-2: #faf9fb;
  --color-border: #ececef;
  --color-border-strong: #d6d6db;

  --color-text: #1e2030;
  --color-text-sub: #6b7081;
  --color-text-mute: #a0a3b1;

  /* Pink primary (matches reference admin UI) */
  --color-primary: #ef4779;
  --color-primary-strong: #d2305f;
  --color-primary-soft: #fce4ea;
  --color-primary-tint: #fdf2f5;
  --color-accent: #f472b6;

  /* Dark panel stays for caption/character contrast */
  --color-dark: #1a1c26;
  --color-dark-2: #20232f;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(30, 32, 48, 0.05);
  --shadow-md: 0 4px 12px rgba(30, 32, 48, 0.08);
  --shadow-lg: 0 12px 32px rgba(30, 32, 48, 0.14);

  --header-h: 56px;
  /* 字幕(.cap)の最低高さ（≒3行＋余白）。利用可能高さ(--avail-h)はこの分を
     差し引いてスライドを 16:9 に最大化する。 */
  --cap-min: 116px;
  --toc-min: 280px;
  /* スライド 16:9 の基準。利用可能な縦 × 16/9 をスライド幅とし、目次は残り全部。 */
  --avail-h: calc(100vh - var(--header-h) - var(--cap-min) - 42px);
  --slide-w: calc(var(--avail-h) * 16 / 9);
  /* 説明員(9:16)の横幅（PC・右下固定）。 */
  --char-w: clamp(220px, 20vw, 300px);

  --font-stack: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont,
    "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: var(--font-stack);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1; /* tighter JP kerning */
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

/* `hidden` attribute must always win against any `display:` */
[hidden] { display: none !important; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
}

.app-header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
  user-select: none;
}

/* Legacy text-based brand mark/name kept for any non-migrated caller. */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 800;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  letter-spacing: -0.02em;
}

.brand-name {
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--color-primary);
  font-weight: 700;
}

.app-header__title {
  flex: 1;
  font-size: 14px;
  color: var(--color-text-sub);
}

.app-header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* タイトルが非表示になる狭幅でも常に右端へ寄せる（目次トグルを右上に）。 */
  margin-left: auto;
  gap: 8px;
}

/* "Open PRizmo" link button in header */
.prizmo-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(239, 71, 121, 0.18);
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.prizmo-link-btn:hover {
  background: var(--color-primary-strong);
  border-color: var(--color-primary-strong);
  box-shadow: 0 4px 12px rgba(239, 71, 121, 0.32);
}
.prizmo-link-btn:active { transform: scale(0.98); }
.prizmo-link-btn__icon { font-size: 14px; line-height: 1; }

/* 目次トグル / ハンバーガー（ヘッダー右）。PC では目次カラムの折りたたみ、
   モバイルでは目次ドロワーの開閉に使う。 */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text-sub);
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.nav-toggle:hover {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 18px;
}
.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
/* 目次が開いている状態（PC: 展開中 / モバイル: ドロワー表示中）のアクティブ表現 */
.app.is-nav-open .nav-toggle {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ドロワーの背景スクリム（モバイル）。display 切替ではなく opacity/visibility を
   クラス駆動でトグルする（iOS Safari の position:fixed + display:none 残骸対策）。 */
.app-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.5);
  z-index: 90;
  border: 0;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.app.is-nav-open .app-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ============================================================
   Player layout: 左カラム(スライド + 字幕) | 目次
   ============================================================ */
.player {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 14px 24px 18px;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  background: var(--color-bg);
}

/* PC: 目次を折りたたんだらスライド/字幕を横いっぱいに広げる。 */
.app.is-nav-collapsed .stage { grid-template-columns: 1fr; }
.app.is-nav-collapsed .slide-nav { display: none; }
.app.is-nav-collapsed .stage__left { grid-column: 1; }

/* --- Stage: 目次(左・残り全部) | スライド+字幕(右) --- */
.stage {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr min(var(--slide-w), calc(100% - var(--toc-min) - 14px));
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}
/* 目次=左カラム、スライド+字幕=右カラムに明示配置（DOM 順では stage__left が
   先だが、左右を入れ替えて配置する）。 */
.slide-nav { grid-column: 1; grid-row: 1; }
.stage__left { grid-column: 2; grid-row: 1; }

/* 左カラム: スライド(上寄せ) + 字幕(.cap)。スライドの下に余る分は .cap が
   伸びて埋める。スライドと字幕は同じ幅に揃える。 */
.stage__left {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* スライド領域を 16:9 に固定。幅は「カラム幅」と「利用可能な縦×16/9」の
   小さい方。高さは aspect-ratio。 */
.slide-area {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, var(--slide-w));
  aspect-ratio: 16 / 9;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #0b1220;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slide-image.is-loaded {
  opacity: 1;
}

/* まとめスライドのフッタ合成オーバーレイ。slide-image と同寸・同位置に重ね、
   multiply で白地を素通し・背景のフッタ（文字＋ロゴ）だけを載せる。 */
.slide-summary-footer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 2;
}
.slide-summary-footer[hidden] { display: none; }
/* まとめ保存ボタン（まとめ表示時のみ）。 */
.slide-summary-dl {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 8;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(13, 20, 36, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
}
.slide-summary-dl:hover { background: rgba(13, 20, 36, 0.95); }
.slide-summary-dl[hidden] { display: none; }

/* 動画スライド: 背景の上に動画をスライド中央へ contain で重ねる。 */
.slide-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 2;
}
.slide-video-overlay[hidden] { display: none; }
.slide-video {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
}
.slide-video-youtube {
  /* iframe のサイズは fitYoutubeIframe() (app.js) で .slide-frame の実寸から
     16:9 contain で計算して style 直書きする。 */
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-video-youtube iframe {
  border: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* "Ready to play" overlay (after build completes) */
.slide-ready-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(11, 18, 32, 0.45);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
  backdrop-filter: blur(2px);
  z-index: 7;
}
.slide-ready-overlay:hover { background: rgba(11, 18, 32, 0.65); }
.slide-ready-overlay__icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.4);
  padding-left: 4px;
}
.slide-ready-overlay__label { font-size: 14px; letter-spacing: 0.04em; }

/* ==========================================================
   全画面（拡大）モード
   ========================================================== */
/* スライド枠そのものを最前面に固定して大きく表示（promote）。画像も動画も
   そのまま映るので、動画スライドに進んでも全画面は維持される。 */
.app.is-slide-zoom .slide-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  z-index: 300;
  border-radius: 0;
  background: #000;
}

/* 閉じるボタン（全画面中のみ表示） */
.slide-zoom-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 320;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: none;
  font-size: 26px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slide-zoom-close:hover { background: rgba(255, 255, 255, 0.3); }
.app.is-slide-zoom .slide-zoom-close { display: flex; }

/* ==========================================================
   Pre-info form view (replaces slide-area while state=form)
   ========================================================== */
.form-area {
  display: none;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}

.form-card {
  /* Fill the available column (matches .slide-frame). */
  flex: 1;
  min-height: 0;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  /* Inner scroll: overflow happens inside the card so the white background
     fills the whole area at all scroll positions. */
  overflow: auto;
  padding: 28px 36px;
  gap: 16px;
}

.form-card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.form-card__intro {
  margin: 0;
  font-size: 13.5px;
  color: var(--color-text-sub);
  line-height: 1.7;
  white-space: pre-line;
}

.preinfo-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.preinfo-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preinfo-field__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preinfo-field__required {
  font-size: 10px;
  color: #b91c1c;
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.preinfo-field__input,
.preinfo-field__textarea,
.preinfo-field__select {
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
}
.preinfo-field__input:focus,
.preinfo-field__textarea:focus,
.preinfo-field__select:focus {
  outline: 2px solid var(--color-primary-soft);
  border-color: var(--color-primary);
}

.preinfo-field__textarea { min-height: 78px; resize: vertical; }

.preinfo-field__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 4px;
}

.preinfo-field__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.preinfo-field__option:has(input:checked) {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.preinfo-field__error {
  font-size: 11px;
  color: #b91c1c;
  display: none;
}
.preinfo-field.is-invalid .preinfo-field__error { display: block; }
.preinfo-field.is-invalid .preinfo-field__input,
.preinfo-field.is-invalid .preinfo-field__textarea,
.preinfo-field.is-invalid .preinfo-field__select {
  border-color: #b91c1c;
}

.form-card__privacy {
  margin: 0;
  font-size: 11px;
  color: var(--color-text-mute);
}

.form-card__actions { display: flex; justify-content: flex-end; }

.form-card__submit {
  background: var(--color-primary);
  color: #fff;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  justify-content: center;
  transition: background 0.15s ease, transform 0.05s ease;
  position: relative;
}
.form-card__submit:hover { background: var(--color-primary-strong); }
.form-card__submit:active { transform: scale(0.99); }
.form-card__submit:disabled,
.form-card__submit.is-loading {
  background: var(--color-primary-strong);
  cursor: progress;
  opacity: 0.95;
}
.form-card__submit .ctrl-btn__spinner { display: none; }
.form-card__submit.is-loading .ctrl-btn__spinner { display: inline-block; }
.form-card__submit.is-loading .form-card__submit-label { opacity: 0.6; }

.form-card__error {
  margin: 0;
  font-size: 13px;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 6px;
  padding: 8px 12px;
}

/* ==========================================================
   App state toggles
   ==========================================================
   - form / submitting → form panel in left column, slide & caption hidden
   - building → slide column shows the building animation; caption hidden
   - ready / playing → slide + caption visible, character shown
*/
.app[data-state="form"] #slideArea,
.app[data-state="submitting"] #slideArea { display: none; }

.app[data-state="form"] #formArea,
.app[data-state="submitting"] #formArea { display: flex; }

.app[data-state="building"] #formArea { display: none; }

/* 操作パネル(スライド上)とタイトルメタは再生前(フォーム/送信/ビルド)は隠す。 */
.app[data-state="form"] #dockControls,
.app[data-state="submitting"] #dockControls,
.app[data-state="building"] #dockControls,
.app[data-state="loading"] #dockControls { display: none; }

/* フォーム/ビルド中も、スライド再生中と同じ 16:9 の主表示枠に揃える（PC）。
   フォーム枠はスライドと同じ 16:9・同位置・同幅にし、字幕(.cap)はその下に充填
   する（字幕は flex:1 1 auto の既定のまま＝再生中と同様に下を埋める）。 */
.app[data-state="form"] #formArea,
.app[data-state="submitting"] #formArea {
  flex: 0 0 auto;
  width: min(100%, var(--slide-w));
  aspect-ratio: 16 / 9;
  min-height: 0;
}

/* 説明員(.char)はロード中のみ隠す（フォーム/ビルド中も案内役として表示）。
   手動で × した場合も is-hidden で隠す。 */
.app[data-state="loading"] .char,
.char.is-hidden { display: none; }

/* While building, only the building overlay is visible inside slide-frame. */
.app[data-state="building"] .slide-image { opacity: 0; }
.app[data-state="building"] #readyOverlay { display: none; }

/* slide-building overlay defaults hidden; visible during building. */
.slide-building { display: none; }
.app[data-state="building"] .slide-building { display: flex; }

/* ビルド中もスライド枠は 16:9 のまま（再生中と揃える）。ビルド中オーバーレイは
   16:9 内に収め、はみ出す内容は .slide-building__content がスクロールで吸収する。
   ※モバイルは 16:9 が低く内容が見切れるため、レスポンシブ側でステージ一杯に広げる。 */
.app[data-state="building"] .slide-image { display: none; }
.slide-building__content {
  max-height: 100%;
  overflow-y: auto;
}

/* When form is showing, the slide-nav becomes a read-only outline. */
.app[data-state="form"] .slide-nav__item,
.app[data-state="submitting"] .slide-nav__item,
.app[data-state="building"] .slide-nav__item {
  cursor: default;
  pointer-events: none;
}

/* During submitting, dim the form to indicate loading. */
.app[data-state="submitting"] .form-card {
  opacity: 0.55;
  pointer-events: none;
}

/* ==========================================================
   Building overlay
   ========================================================== */
.slide-building {
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 5;
}

.slide-building__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(239, 71, 121, 0.45), transparent 55%),
              radial-gradient(circle at 75% 75%, rgba(244, 114, 182, 0.4), transparent 55%),
              linear-gradient(180deg, #1a1c26 0%, #221d2c 100%);
}
.slide-building__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 60%);
  animation: building-shimmer 6s linear infinite;
}
@keyframes building-shimmer {
  0%   { transform: rotate(0deg) scale(1.1); opacity: 0.6; }
  50%  { opacity: 1; }
  100% { transform: rotate(360deg) scale(1.1); opacity: 0.6; }
}

.slide-building__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 520px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.slide-building__pulse {
  display: flex;
  gap: 10px;
}
.slide-building__pulse span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  display: inline-block;
  animation: building-pulse 1.4s ease-in-out infinite;
}
.slide-building__pulse span:nth-child(2) { animation-delay: 0.2s; background: var(--color-accent); }
.slide-building__pulse span:nth-child(3) { animation-delay: 0.4s; background: #fb7185; }
@keyframes building-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.6; }
  50%      { transform: scale(1.2); opacity: 1; }
}

.slide-building__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.slide-building__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.78);
}

.slide-building__progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 12px 18px;
}
.slide-building__step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}
.slide-building__step .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.slide-building__step.is-done .dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}
.slide-building__step.is-done { color: rgba(255, 255, 255, 0.78); }
.slide-building__step.is-active .dot {
  background: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(239, 71, 121, 0.5);
  animation: step-pulse 1.4s ease-out infinite;
}
.slide-building__step.is-active { color: #fff; font-weight: 600; }
@keyframes step-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 71, 121, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(239, 71, 121, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 71, 121, 0); }
}

/* --- Summary image still generating overlay --- */
.slide-summary-pending {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.18), transparent 55%),
              linear-gradient(180deg, #1a1c26 0%, #221d2c 100%);
  color: #fff;
  text-align: center;
  padding: 16px 24px;
  overflow-y: auto;
  z-index: 4;
}
.slide-summary-pending[hidden] { display: none; }

.slide-summary-pending__pulse {
  display: flex;
  gap: 10px;
}
.slide-summary-pending__pulse span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  display: inline-block;
  animation: building-pulse 1.4s ease-in-out infinite;
}
.slide-summary-pending__pulse span:nth-child(2) { animation-delay: 0.2s; background: var(--color-accent); }
.slide-summary-pending__pulse span:nth-child(3) { animation-delay: 0.4s; background: #fb7185; }

.slide-summary-pending__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}
.slide-summary-pending__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.78);
  max-width: 480px;
}

/* --- Slide nav (目次) --- */
.slide-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.slide-nav__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-sub);
  background: var(--color-surface-2);
}

.slide-nav__count {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-mute);
}

.slide-nav__item { direction: ltr; }
.slide-nav__list::-webkit-scrollbar { width: 8px; }
.slide-nav__list::-webkit-scrollbar-track { background: transparent; }
.slide-nav__list::-webkit-scrollbar-thumb {
  background: rgba(120, 140, 170, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.slide-nav__list::-webkit-scrollbar-thumb:hover { background: rgba(120, 140, 170, 0.72); }
.slide-nav__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  direction: rtl;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 140, 170, 0.5) transparent;
  overflow-y: auto;
  flex: 1;
}

.slide-nav__item {
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.slide-nav__item:hover {
  background: var(--color-primary-tint);
}

.slide-nav__item.is-active {
  background: var(--color-primary-soft);
  border-left-color: var(--color-primary);
}

.slide-nav__index {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-mute);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  padding-top: 2px;
}

.slide-nav__item.is-active .slide-nav__index {
  color: var(--color-primary);
}

.slide-nav__body {
  flex: 1;
  min-width: 0;
}

.slide-nav__chapter {
  font-size: 10px;
  color: var(--color-text-mute);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.slide-nav__title {
  font-size: 12.5px;
  color: var(--color-text);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slide-nav__item.is-active .slide-nav__title {
  font-weight: 700;
  color: var(--color-primary-strong);
}

.slide-nav__item--summary .slide-nav__chapter {
  color: var(--color-primary);
}

/* 動画スライドはタイトル左に小さな ▶ バッジで識別 */
.slide-nav__video-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 4px;
  background: rgba(239, 71, 121, 0.18);
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

/* ============================================================
   字幕パネル(.cap) + 説明員(.char)
   ============================================================ */
.cap {
  flex: 1 1 auto;
  width: min(100%, var(--slide-w));
  min-height: var(--cap-min);
  position: relative;
  background: #0b1220;
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.cap__t {
  font-size: 20px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* welcome_message / building_message の改行を反映。 */
  white-space: pre-line;
  transition: opacity 0.2s ease;
}
/* ドック: PC では中身(.char)が fixed なので display:contents で場所を取らない。
   モバイル縦では下部の常時バーになる（レスポンシブ側で定義）。 */
.dock { display: contents; }

/* タイトルカード(.dock__meta): PC では非表示。モバイル縦ではスライド上に「見出し
   カード」として表示する（レスポンシブ側で display:flex）。 */
.dock__meta {
  display: none;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(20, 24, 40, 0.05);
}
.dock__meta-bar {
  flex: 0 0 auto;
  width: 4px;
  align-self: stretch;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-accent));
}
.dock__meta-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dock__meta .slide-chapter {
  align-self: flex-start;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--color-primary-strong); background: var(--color-primary-soft);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.dock__meta .slide-title {
  margin: 0;
  font-size: 16px; font-weight: 800; color: var(--color-text); line-height: 1.42; letter-spacing: 0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 説明員: PC は目次(左カラム)の右端＝スライド左端に右端を合わせて固定（9:16）。
   スライドの隣に立たせて「説明している感」を出す。右オフセット = スライド列の幅
   + player の右パディング(24px)。 */
.char {
  position: fixed;
  right: calc(24px + min(var(--slide-w), calc(100vw - 62px - var(--toc-min))));
  bottom: 0;
  z-index: 40;
  width: var(--char-w);
  aspect-ratio: 9 / 16;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
/* 目次を折りたたむとスライドは中央寄せになり左右に余白ができる。説明員は画面の
   左下に寄せ、中央のスライドにかぶらないようにする（多くの画面幅で左余白に収まる）。 */
.app.is-nav-collapsed .char { left: 0; right: auto; }
.char__media { position: relative; width: 100%; }
/* 元動画は不可視だが描画ツリーには残す（display:none だと一部ブラウザで
   WebGL のフレーム取得が止まるため opacity:0 にする）。canvas にキー結果を描画。 */
.char__video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.char__canvas { position: relative; z-index: 1; display: block; width: 100%; height: auto; }
.char__fallback { display: block; width: 100%; height: auto; object-fit: contain; }
.char__fallback[hidden] { display: none; }

.char__plate {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
  white-space: nowrap;
  background: rgba(10, 16, 30, 0.7);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 5px 13px;
  z-index: 3;
}
.char__name { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 0.02em; }
.char__role { font-size: 9.5px; color: rgba(255, 255, 255, 0.72); letter-spacing: 0.04em; }

.char__live {
  position: absolute;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 9px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}
.char.is-talking .char__live { opacity: 1; }

.char__hide {
  position: absolute;
  top: 3px; right: 3px;
  z-index: 4;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 0;
  font-size: 13px;
  line-height: 1;
  display: none; /* PC では非表示。モバイルで表示。 */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}
.char__show {
  position: fixed;
  right: 12px; bottom: 12px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: 0;
  font-size: 18px;
  display: none; /* 既定は非表示。モバイルで is-hidden 時のみ表示（JS）。 */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(239, 71, 121, 0.4);
}
.char__show[hidden] { display: none !important; }

/* 名前プレートの脈動ドット（ON AIR） */
.dock__pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse 1.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ============================================================
   操作パネル（スライド上にホバー/タップで表示）
   ============================================================ */
.ctrls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0) 0%, rgba(11, 18, 32, 0.82) 60%);
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.slide-frame:hover .ctrls,
.slide-frame.show-ctrls .ctrls { opacity: 1; transform: none; pointer-events: auto; }

.controls__transport {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.05s ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.ctrl-btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.ctrl-btn--primary:hover {
  background: var(--color-primary-strong);
}

.ctrl-btn--primary .ctrl-btn__icon {
  display: inline-flex;
}

/* 操作アイコンは絵文字記号ではなくインライン SVG（currentColor=白）で統一。 */
.ctrl-btn svg { width: 18px; height: 18px; display: block; }
.ctrl-btn--primary svg { width: 20px; height: 20px; }
.ctrl-btn__icon { align-items: center; justify-content: center; }
/* 再生/一時停止トグル: 既定は再生(▶)、再生中(.is-playing)は一時停止(⏸)。 */
.ctrl-btn--primary .i-pause { display: none; }
.ctrl-btn--primary.is-playing .i-play { display: none; }
.ctrl-btn--primary.is-playing .i-pause { display: block; }

.ctrl-btn--primary .ctrl-btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.ctrl-btn--primary.is-loading {
  cursor: progress;
}

.ctrl-btn--primary.is-loading .ctrl-btn__icon {
  display: none;
}

.ctrl-btn--primary.is-loading .ctrl-btn__spinner {
  display: inline-block;
}

/* まとめ画像待ちで再生をゲートしている間の無効表示。 */
.ctrl-btn.is-disabled,
.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.controls__progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress {
  position: relative;
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
}

.progress__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.15s linear;
  border-radius: 999px;
}

.progress__chapters {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.progress__tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.3);
}

.controls__time {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.time-sep {
  margin: 0 4px;
  color: rgba(255, 255, 255, 0.5);
}

.controls__options {
  display: flex;
  gap: 6px;
}

.opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  min-width: 36px;
  height: 32px;
}

.opt-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.opt-btn--on {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.opt-btn--on:hover {
  background: var(--color-primary-strong);
}

/* アイコンのみのオプションボタン（拡大表示など） */
.opt-btn--icon { padding: 6px 8px; min-width: 32px; }
.opt-btn--icon svg { display: block; }

#btnSpeed {
  min-width: 44px;
  font-variant-numeric: tabular-nums;
}

.opt-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.opt-icon svg { width: 15px; height: 15px; display: block; }

/* ============================================================
   CTA Overlay
   ============================================================ */
.cta-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.25s ease;
}

.cta-overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cta-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 40px 48px 36px;
  width: min(560px, 92vw);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: cardIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes cardIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.cta-card__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.cta-card__title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.cta-card__lead {
  font-size: 14px;
  color: var(--color-text-sub);
  margin: 0 0 20px;
  line-height: 1.7;
}

.cta-card__summary {
  text-align: left;
  background: var(--color-primary-soft);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 0 0 24px;
}

.cta-card__summary[hidden] {
  display: none;
}

.cta-card__summary-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-primary-strong);
}

.cta-card__summary-list li {
  margin-bottom: 4px;
}

.cta-card__summary-list li::marker {
  color: var(--color-accent);
}

.cta-card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, border-color 0.15s ease;
}

.cta-btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-border-strong);
}

.cta-btn:active {
  transform: scale(0.99);
}

.cta-btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.cta-btn--primary:hover {
  background: var(--color-primary-strong);
  border-color: var(--color-primary-strong);
}

.cta-btn__icon {
  font-size: 16px;
}

.cta-card__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--color-text-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cta-card__close:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* ============================================================
   Responsive
   ============================================================ */
/* ---- 中型デスクトップ: 説明員/目次を少し小さく ---- */
@media (max-width: 1200px) {
  :root {
    --char-w: clamp(200px, 18vw, 260px);
    --toc-min: 240px;
  }
  .cap__t { font-size: 18px; }
}

/* ============================================================
   モバイル / 小型タブレット (≤900px)
   縦: ヘッダ / 見出しカード / スライド(16:9) / 字幕 / ドック(説明員+操作)
   横: スライドのみ全画面 + タップで操作パネル
   ============================================================ */
@media (max-width: 900px) {
  :root {
    --header-h: 52px;
    --cap-min: 0px;
    /* モバイルの下部ドック高（セーフエリア込み）。下部カラーアンカーにも使う。 */
    --mdh: calc(clamp(150px, 23vh, 196px) + env(safe-area-inset-bottom));
  }

  /* アプリ全体を可視ビューポート (dvh) ぴったりに。 */
  .app {
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* iOS Safari は端付近のページ背景色から上下ツールバー帯の色を決める。body を
     デッキ色にして下のバー帯をデッキ色に寄せる。iOS は上下を同色で塗るため上の
     アドレスバーも暗くなるが、上下とも白より見栄えが良いとの判断でこの方式。 */
  html, body { background-color: #121a2e; }

  .app-header { padding: 0 12px; gap: 10px; }
  .app-header__title { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-logo { height: 26px; }
  .prizmo-link-btn { padding: 7px 10px; }
  .prizmo-link-btn__label { display: none; }

  /* エッジ・トゥ・エッジ: 外側余白/角丸/枠を外して隙間なく大きく見せる。 */
  .player {
    gap: 0;
    padding: 0;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
  }

  /* 目次はドロワー。ステージは単一カラム（PC の左右入替の明示配置をリセット）。 */
  .stage { grid-template-columns: 1fr; gap: 0; }
  .app.is-nav-collapsed .stage { grid-template-columns: 1fr; }
  .stage__left { grid-column: 1; }

  /* ===== 縦積み: スライド / 字幕 / ドック（すべて全幅・枠なし・flush）=====
     （タイトル見出しは実機で字幕が潰れるため非表示。タイトルは目次で確認。） */
  .stage__left { flex-direction: column; align-items: stretch; gap: 0; }

  /* スライド: 全幅16:9（小さめ）。角丸/影を外してエッジ・トゥ・エッジ。 */
  .slide-area { flex: 0 0 auto; width: 100%; aspect-ratio: 16 / 9; }
  .slide-frame { border-radius: 0; box-shadow: none; }

  /* 字幕: ヘッダと同じ白・枠なし（角丸/影なし）。ヘッダ〜スライド〜字幕が地続きに
     見えるよう枠感を最小化。テキストは濃色・上寄せ。残り高さを可読エリアに。 */
  .cap {
    flex: 1 1 auto;
    width: auto;
    min-height: 0;
    align-self: stretch;
    justify-content: flex-start;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 0;
    box-shadow: none;
    padding: 16px 18px;
  }
  .cap__t { font-size: 16px; line-height: 1.7; -webkit-line-clamp: 7; }

  /* ドック（フッター）: 全幅・角丸/影なし。説明員のグリーンキーが映えるよう暗い面。
     操作パネル(#dockControls)は JS が縦向き時にこの中へ移動する。 */
  .dock {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 12px;
    background: #121a2e;
    color: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    height: var(--mdh);
  }

  /* 説明員: 約半分の高さ。ドック左に接地（fixed を解除して通常フローへ）。 */
  .char {
    position: relative;
    right: auto; bottom: auto;
    flex: 0 0 auto;
    width: auto;
    height: 100%;
    aspect-ratio: 9 / 12;
    z-index: auto;
    align-self: flex-end;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
  }
  .char__media { position: relative; width: 100%; height: 100%; }
  /* canvas: height 基準・上を少しクロップして頭上の隙間を除去。 */
  .char__canvas {
    position: absolute; left: 50%; transform: translateX(-50%);
    height: 118%; width: auto; margin-top: -12%;
  }
  .char__plate { flex-direction: row; align-items: baseline; gap: 5px; bottom: 5px; padding: 2px 9px; }
  .char__name { font-size: 10px; }
  .char__role { font-size: 8px; padding-left: 5px; border-left: 1px solid rgba(255, 255, 255, 0.26); }
  .char__live { display: none; }
  .char__hide { display: flex; }
  .char__show:not([hidden]) { display: flex; }

  /* 操作パネル: ドック内（縦向きで JS が #dockControls をここへ移動）。
     スライド上オーバーレイ用の絶対配置/ホバー表示を解除し、縦並びの常時表示に。 */
  .dock #dockControls {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 0;
    margin: 0;
    background: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .dock .controls__transport { justify-content: center; gap: 16px; }
  .dock .controls__progress { width: 100%; }
  .dock .controls__options { justify-content: center; gap: 8px; }
  .dock .ctrl-btn { width: 44px; height: 44px; }
  .dock .ctrl-btn--primary { width: 52px; height: 52px; }
  .dock .ctrl-btn svg { width: 20px; height: 20px; }
  .dock .ctrl-btn--primary svg { width: 22px; height: 22px; }

  /* ---- 目次: 右からのドロワー ---- */
  .slide-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(320px, 84vw);
    z-index: 100;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .app.is-nav-open .slide-nav {
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.28);
  }

  /* フォーム/送信中: フォームを全面表示。見出し/字幕/ドックは隠す。 */
  .app[data-state="form"] .dock__meta,
  .app[data-state="submitting"] .dock__meta,
  .app[data-state="form"] .cap,
  .app[data-state="submitting"] .cap,
  .app[data-state="form"] .dock,
  .app[data-state="submitting"] .dock,
  /* ビルド中: ビルドオーバーレイ(スライド)を主役に。 */
  .app[data-state="building"] .dock__meta,
  .app[data-state="building"] .cap,
  .app[data-state="building"] .dock { display: none; }

  /* モバイルではフォーム/ビルドは 16:9 にせずステージ一杯に広げる（16:9 だと縦が
     低く内容が見切れるため。PC は 16:9 に揃える）。 */
  .app[data-state="form"] #formArea,
  .app[data-state="submitting"] #formArea {
    width: 100%;
    aspect-ratio: auto;
    flex: 1 1 auto;
  }
  .app[data-state="building"] .slide-area {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
  }

  /* フォーム(事前ヒアリング)も角丸/影/枠を外してエッジ・トゥ・エッジに統一。
     カード内のフィールド用パディングは残す。ビルド中はスライド枠の角丸を外す
     ことで(上の .slide-frame ルール)同様にフラットになる。 */
  .form-card {
    border-radius: 0;
    box-shadow: none;
    border: 0;
    padding: 18px 16px;
  }

  /* ビルド中オーバーレイの文字サイズ縮小 */
  .slide-building__title { font-size: 19px; }
  .slide-building__desc { font-size: 12px; }
  .slide-building__progress { padding: 10px 14px; }
  .slide-summary-pending__title { font-size: 18px; }
}

/* ===== モバイル横向き: スライドのみ全画面 + タップで操作パネル ===== */
@media (max-width: 900px) and (orientation: landscape) {
  .app-header { display: none; }
  .player { padding: 0; gap: 0; }
  .dock__meta, .cap, .dock { display: none; }
  /* スライドを画面いっぱいに固定表示。CTA(z-index:100)等は上に出せるよう z-index は控えめに。 */
  .slide-area {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    z-index: 50;
  }
  .slide-frame { border-radius: 0; background: #000; }
  /* 操作パネルはスライド下部にタップ表示（.show-ctrls）。 */
  .slide-frame.show-ctrls .ctrls { opacity: 1; transform: none; pointer-events: auto; }
}

/* 横幅の狭い端末の微調整（縦向き想定） */
@media (max-width: 820px) and (orientation: portrait) {
  .cap__t { font-size: 15px; }
}

/* ============================================================
   Common alert modal for the player (app.js: playerAlert)
   ============================================================ */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.player-modal[hidden] { display: none; }
.player-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.player-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 22px 24px;
  width: min(440px, 92vw);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  z-index: 1;
}
.player-modal__title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #1e2030;
}
.player-modal__message {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #1e2030;
  white-space: pre-wrap;
}
.player-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.player-modal__actions .ctrl-btn {
  padding: 8px 22px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
}
