/* MarchinZ 本体のトンマナ(白基調・ネイビー/ブルー/アンバー3色)に統一。
   トークンは styles.css の :root と同値。レイアウトは変えず色だけ差し替える */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6f8; --panel: #ffffff; --panel2: #f0f2f6; --line: rgba(15, 33, 56, 0.12);
  --tx: #0c0f14; --tx2: rgba(12, 15, 20, 0.65);
  --navy: #0f2138; --acc: #1e4fd6; --acc-deep: #163b9e; --acc2: #d97706;
  --ok: #1e7a43; --warn: #9a6a00; --err: #c0392b;
  --cream: #fefcef;
  --shadow-card: 0 1px 2px rgba(15, 33, 56, 0.05), 0 4px 16px rgba(15, 33, 56, 0.06);

  /* ---- 2026-08-07 ブラッシュアップで足したトークン ----
     それまで色15個しか無く、角丸19種・文字サイズ24種・余白はトークン0だった。
     「チップがバラバラ」の構造的な原因はここ。値は既存の実測値から代表を採る */
  /* 選択中の正本。これまで #f4f7ff / #e8f1fe / #f0f5ff / rgba(30,79,214,.06) /
     ベタ塗り の5通りが同じ「選ばれている」を意味していた。
     ★ 塗りではなく「白抜き+内側リング」を正本にする ─ 親パネルが薄青(#f4f8ff)
       なので、薄青で塗ると実測 1.006:1(rgb距離1)で消える */
  --sel-bg: #ffffff;
  --sel-ring: var(--acc);
  --sel-tint: #e8f1fe;          /* 塗りが要る場面(タブ等)だけ */
  /* 無効。opacity で薄めると primary の白文字が 6.68:1 -> 2.14:1 まで落ちる
     (実測。WCAGは無効部品を免除するが、主役CTAがこの見え方なのは品質の問題) */
  --off-bg: #f2f4f8; --off-tx: #7a828f; --off-line: rgba(15, 33, 56, 0.10);
  --off-primary-bg: #dde3ec; --off-primary-tx: #5c6675;
  /* 角丸 */
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  /* これまで未定義のまま var() のフォールバックだけで動いていた3つ。
     明示しないと、名前を整理した瞬間に別の色が出る(潜伏していた地雷) */
  --muted: #667085;
  --sub: rgba(12, 15, 20, 0.55);
  --acc2-text: #b45309;
}
/* ★ キャンバスを一段沈める(2026-08-07 ビジュアルレビュー🔴)。
   実測で ページ#eef1f5 → パネル#f4f8ff が 1.064:1、白カードでも 1.133:1 しかなく、
   --shadow-card(5〜6%)がこの明度差では見えない = 「どこが操作面か」が伝わらない。
   パネル側の色は一切触らず、下地だけ沈めて階層を作る
   (intake 1.064→1.12 / 白カード 1.133→1.20) */
html { background: #e6ebf2; }
/* ★ キーボード操作の居場所(2026-08-07 ビジュアルレビュー🟢)。
   2200行のCSSで :focus-visible は1件しか無く、iPad+外部キーボードで
   どこにいるか分からなかった。:where() は詳細度0なので既存指定を一切上書きしない */
:where(button, a, input, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--acc); outline-offset: 2px; border-radius: var(--r-sm);
}
* { -webkit-tap-highlight-color: transparent; }
body { background: transparent; color: var(--tx); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; font-size: 14px;
  /* ★ 和文の行間(2026-08-07 ビジュアルレビュー🟡)。line-height:normal(≒1.18)の
     可視テキストが20種あり、1行に収まっている今は目立たないが、2行に
     折り返した瞬間に詰まって見える。和文の下限は1.6〜1.75 */
  line-height: 1.7; }

/* 3ツール共通: キービジュアルの上に白い透明を重ねた背景(iOS配慮でposition:fixed) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)), url("/images/lp/hero-show.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* ヘッダーは本体TOPと同じクリーム地+ネイビー文字 */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px;
  background: var(--cream); border-bottom: 1px solid var(--line); }
/* MarchinZ本体のロゴを先頭に置き、あくまでMarchinZページ内であることを示す */
.head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mz-home { display: inline-flex; align-items: center; flex-shrink: 0; }
.mz-logo { height: 34px; width: auto; display: block; }
.tool-name {
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700;
  color: var(--navy); white-space: nowrap; padding-left: 10px; border-left: 1px solid var(--line);
}
/* ★ ここから下の小片(チップ/バッジ)は1規格に揃える(2026-08-07 ビジュアルレビュー🟡)。
   実測で font-size 5種・border-radius 4種・padding 9種の**10規格**が混在し、
   同じヘッダーの中で「ベータ版」(10px/999px)と「対応確認中…」(12px/20px)が
   別の書体系に見えていた。規格 = 11px / 999px / 2px 9px。
   11px を下限にするのは、iPhoneで10px以下が読みづらいため(色は各自のまま) */
.caps-badge { font-size: 11px; color: var(--tx2); background: #fff; border: 1px solid var(--line); padding: 2px 9px; border-radius: var(--r-pill); }

/* MarchinZ 統合(ベータ版バッジ+戻るリンク)。バッジは本体 .mz-ctools-beta と同配色 */
.beta-badge {
  font-size: 11px; font-weight: 700; color: #866a19; background: #fdf3d7;
  border: 1px solid #ecd9a0; border-radius: var(--r-pill); padding: 2px 9px;
  white-space: nowrap; vertical-align: 2px;
}
.head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* ★ 左端に移した戻る(2026-08-02 ⑨)の指の的を44ptに(2026-08-03 push前レビュー実測: 38×18px)。
   縦は負のマージンで相殺し、ヘッダーの高さは変えない(的だけ広げる) */
.back-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px;
  margin: -13px 0; padding: 0 8px 0 0;
  font-size: 12px; color: var(--acc); text-decoration: none; white-space: nowrap; }
.back-link:hover { color: var(--acc-deep); text-decoration: underline; }
@media (max-width: 700px) { .head-right .caps-badge { display: none; } }


/* display指定のあるクラスは [hidden] より詳細度で勝つため、hidden を常に優先させる
   (過去にPrivacyの管理者限定ボタンが誰にでも見えた事故と同じ罠) */
[hidden] { display: none !important; }

.wrap { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.side { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-card); }
.panel h2 { font-size: 14px; margin-bottom: 10px; color: var(--navy); }
.hint { color: var(--tx2); font-size: 11px; font-weight: normal; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }

/* ---- ワイプの小窓設定 ----
   小窓1と2を同じ列で揃える(ラベル幅の差でドロップダウンがズレていた)。
   大きさは両方に効く設定なので、小窓1の行に混ぜず独立させる */
.wipe-grid {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px; align-items: center; margin: 8px 0;
}
.wipe-grid > label { white-space: nowrap; }
.wipe-grid > .select { width: 100%; min-width: 0; margin: 0; min-height: 44px; }
.wipe-size { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; }
.wipe-size > label { white-space: nowrap; }
.wipe-size > input[type="range"] { flex: 1; min-width: 0; height: 44px; }
@media (max-width: 430px) {
  /* 狭い画面ではラベルを行頭に置いて、選択肢を横並びのまま2列に */
  .wipe-grid { grid-template-columns: minmax(0, 1fr) auto; }
  .wipe-grid > label { grid-column: 1 / -1; margin-top: 2px; }
}

.dropzone { border: 2px dashed rgba(15, 33, 56, 0.25); border-radius: 10px; padding: 20px; text-align: center;
  color: var(--tx2); cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--acc); color: var(--tx); background: #f4f7ff; }
.dz-icon { font-size: 26px; margin-bottom: 4px; }

.clip-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
/* 動画1/2/3スロット */
.clip-slots { display: flex; flex-direction: column; gap: 12px; }
/* おまかせで動画1本のときの常設の案内(2026-08-02)。責めない色で1行 */
/* おまかせ説明の上限(◯◯だから△△まで)の強調(2026-08-06 優さん指示) */
.mode-desc-limit { color: var(--acc-deep); font-weight: 700; }
/* ★ 書き出しオーバーレイ(z:120)表示中もトーストを前に(2026-08-06 レビューP0:
   「ビデオを保存」案内が背後に隠れて1pxも見えなかった)。中断ノート(130)よりは下 */
body.mz-export-open .toast { z-index: 125; }
.need-second-note { font-size: 13px; color: var(--acc-deep); background: #f4f7ff;
  overflow-wrap: anywhere;   /* 長い無改行ファイル名(importNote)でも枠から溢れない */
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.need-second-note i { margin-right: 4px; }
.need-second-note span { display: block; margin-top: 3px; color: var(--tx2); font-size: 11.5px; }
.need-second-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.need-second-add { flex: 0 0 auto; min-height: 44px; padding: 0 13px; border: 1px solid var(--acc);
  border-radius: 10px; background: #fff; color: var(--acc-deep); font: 700 12.5px/1.2 inherit;
  cursor: pointer; }
.need-second-add.admin-same { border-style: dashed; }
.need-second-add:hover, .need-second-add:focus-visible { background: var(--sel-tint); }
@media (max-width: 430px) {
  .need-second-note { align-items: stretch; flex-direction: column; }
  .need-second-actions { flex-direction: column; }
  .need-second-add { width: 100%; }
}
/* ★ 押せないラベルに操作色(--acc)を使わない(2026-08-07 ビジュアルレビュー🟢)。
   「動画1」は見出しであって押せない。青は「押せる/選ばれている」専用に温存する */
.clip-slot-label { font-size: 11px; font-weight: 700; color: var(--tx2); margin-bottom: 6px; letter-spacing: 0.02em; }
.clip-slot.empty .clip-slot-add {
  width: 100%; border: 2px dashed rgba(15, 33, 56, 0.25); border-radius: 10px;
  padding: 16px 12px; text-align: center; color: var(--tx2);
  font-size: 13px; line-height: 1.7; cursor: pointer; font-family: inherit;
  /* ★ 面を持たせる(2026-08-07 ビジュアルレビュー🟡)。画面でいちばん大きい
     操作対象(319x80px x 3)が塗りゼロで、破線は親パネルに対し 1.58:1 しか
     無かった ─ 「置ける場所」が面として存在していなかった */
  background: #fff; box-shadow: 0 1px 2px rgba(15, 33, 56, 0.04);
}
.clip-slot.empty .clip-slot-add:hover, .clip-slots.over .clip-slot.empty .clip-slot-add {
  /* ドラッグ中は色だけでなく**形**も変える(破線→実線)。
     旧 #f4f7ff は親と 1.006:1 で、変化が見えていなかった */
  border-color: var(--acc); border-style: solid; color: var(--acc-deep);
  background: var(--sel-tint); box-shadow: 0 0 0 3px rgba(30, 79, 214, 0.10);
}
/* 素材カード: サムネイルを上に大きく、文字情報はその下にまとめる。
   横並びだと情報側の幅が足りず、微調整ボタン(-1s…+1s)が右へはみ出していた
   (2026-07-22 実機で発覚)。縦積みなら全幅を使えて折り返しも起きない */
.clip-card { display: flex; flex-direction: column; gap: 8px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; position: relative; }
.clip-thumb-wrap {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: #000;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* 切り取らずに全体を見せる。縦型素材でも何が写っているか分かるようにする */
.clip-thumb { width: 100%; height: 100%; object-fit: contain; display: block; }
.clip-thumb--empty { background: #000; }
.clip-info { min-width: 0; }
/* おまかせ: 解像度と長さ、そして「読み込みました」だけ */
.clip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.clip-spec { font-variant-numeric: tabular-nums; }
.clip-ok { color: var(--ok, #1a7f45); font-weight: 700; font-size: 11px; }
.clip-ok i { margin-right: 3px; }
.clip-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-meta { font-size: 11px; color: var(--tx2); margin-top: 2px; }
.clip-sync { font-size: 11px; margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sync-badge { padding: 2px 9px; border-radius: var(--r-pill); font-size: 11px; background: rgba(15, 33, 56, 0.08); color: var(--tx2); }
.sync-badge.wave { background: #e0f5e9; color: var(--ok); }
.sync-badge.ts { background: #fdf3d7; color: var(--warn); }
.sync-badge.ref { background: #e3edf8; color: var(--acc-deep); }
.nudge { display: flex; gap: 3px; flex-wrap: wrap; }   /* はみ出さず折り返す */
.nudge button { background: #fff; border: 1px solid var(--line); color: var(--tx); border-radius: 5px;
  font-size: 10px; padding: 1px 5px; cursor: pointer; }
.nudge button:hover { border-color: var(--acc); }
.clip-remove { position: absolute; top: 6px; right: 8px; background: none; border: none; color: var(--tx2);
  cursor: pointer; font-size: 14px; }
.clip-remove:hover { color: var(--err); }
/* カードの「この動画を選び直す」(2026-08-02 優さん指示)。右上の✕(外す)は
   小さくて気づかれなかったので、名前のついた44ptの一手を並べる(✕は残す)。
   .btn.small のままだと指の的が細すぎるので、高さだけ44ptへ持ち上げる */
.clip-repick { min-height: 44px; margin-top: 6px; align-self: flex-start; }
.pan-row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--tx2);
  margin-top: 4px; flex-wrap: wrap; }
/* ラベル(横位置/役割/出番/撮り方)は縦に折り返させない。
   幅を揃えるとセレクトの左端が縦に並んで読みやすい */
.pan-row > :first-child { white-space: nowrap; flex-shrink: 0; min-width: 34px; }
.pan-row .select-mini { flex: 1; min-width: 0; }

/* 撮り方の自動判定バッジ(定点固定 / カメラマン付き / 手動 / 解析前) */
.rig-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill);
  white-space: nowrap; border: 1px solid transparent; }
.rig-badge.fx { background: #e3edf8; color: var(--acc-deep); border-color: #c3d6ec; }
.rig-badge.op { background: #fdf3d7; color: #866a19; border-color: #ecd9a0; }
.rig-badge.manual { background: #e0f5e9; color: var(--ok); border-color: #b7e0c8; }
.rig-badge.none { background: var(--panel2); color: var(--tx2); border-color: var(--line); }
.pan-row input { flex: 1; accent-color: var(--acc); }

.btn { background: #fff; color: var(--navy); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-size: 13px; font-family: inherit; }
.btn:hover:not(:disabled) { border-color: var(--acc); background: #f4f7ff; }
/* ★ opacity をやめる(2026-08-07 ビジュアルレビュー🔴・実測)。
   opacity はラベルごと薄めるので、.btn.primary の白文字が
   6.68:1 → **2.14:1** まで落ちていた(#easyStartBtn=主役CTAが該当)。
   「押せない」は彩度と影を落として示し、文字は読めるまま残す */
.btn:disabled {
  cursor: default; background: var(--off-bg); color: var(--off-tx);
  border-color: var(--off-line); box-shadow: none;
}
.btn.primary:disabled { background: var(--off-primary-bg); color: var(--off-primary-tx); }
/* 作業中のロック。disabled だけでもクリックは飛ばないが、iOSでは
   押し込みのハイライトが出て「押せた」ように見えるので触感ごと殺す。
   中止ボタンだけは押せないと困るので除外する(2026-07-25 実機で事故) */
body.mz-busy-lock main button,
body.mz-busy-lock main input,
body.mz-busy-lock main select { pointer-events: none; -webkit-tap-highlight-color: transparent; }
/* 中止と、進捗カード自身が出す「中止する」は必ず押せること。
   ここを塞ぐと長い分析を止める手段が無くなる */
body.mz-busy-lock #cancelBtn, body.mz-busy-lock #eoCancel, body.mz-busy-lock #eoClose,
body.mz-busy-lock .mzp-cancel, body.mz-busy-lock .mzp-retry,
body.mz-busy-lock #errorLog button { pointer-events: auto; opacity: 1; }
.btn.primary { background: var(--acc); color: #fff; border: none; font-weight: bold; }
.btn.primary:hover:not(:disabled) { background: var(--acc-deep); }
.btn.big { padding: 11px 18px; font-size: 14px; }
.btn.small { padding: 4px 10px; font-size: 11px; }
.btn.ghost { background: none; }
.btn.danger { background: #fdecec; border: 1px solid #e5b5b5; color: var(--err); }
.btn.round { width: 44px; height: 44px; border-radius: 50%; font-size: 16px; flex-shrink: 0; }

.status { font-size: 12px; color: var(--tx2); margin-top: 6px; min-height: 16px; white-space: pre-line; }
.status .ok { color: var(--ok); } .status .warn { color: var(--warn); } .status .err { color: var(--err); }

.audio-choices { display: flex; flex-direction: column; gap: 6px; }
.audio-choice { display: flex; align-items: center; gap: 8px; background: var(--panel2); padding: 7px 10px;
  border-radius: 8px; cursor: pointer; font-size: 12px; border: 1px solid var(--line);
  /* 指で選ぶラジオ行。実測35pxで44ptに届いていなかった(2026-08-02 push前レビュー) */
  min-height: 44px; }
/* ★ 選択中は白抜き+内側リング(2026-08-07 ビジュアルレビュー🔴)。
   #f4f7ff は親パネル #f4f8ff と実測 1.006:1(rgb距離1)で、選択の表現が
   1px の枠線だけに頼っていた。白へ抜けば親との差がつき、リングで縁も立つ */
.audio-choice.selected {
  border-color: var(--sel-ring); background: var(--sel-bg); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--sel-ring), 0 1px 3px rgba(30, 79, 214, 0.14);
}
.audio-choice input { accent-color: var(--acc); }
.reco-badge { background: var(--acc2); color: #fff; font-size: 11px;
  font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); white-space: nowrap; }
/* 理由バッジ(2026-08-02): 「音割れあり」「風の音あり」。責める色にしない */
.reco-badge.warn { background: var(--panel2, #f2f2f4); color: var(--warn, #b26a00);
  border: 1px solid var(--line); }
.audio-stat { color: var(--tx2); font-size: 10px; margin-left: auto; }

.preset-row { gap: 6px; }
.preset-chip { padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); cursor: pointer;
  font-size: 11px; color: var(--tx2); background: #fff; }
.preset-chip.selected { border-color: var(--acc); color: var(--acc-deep); background: #e8f1fe; font-weight: 700; }
/* 比率が1つに固定のモード(縦型動画)では、選択肢ではなく現在のサイズ表示にする */
.preset-fixed { padding: 5px 10px; border-radius: 16px; background: var(--panel2);
  border: 1px solid var(--line); color: var(--tx2); font-size: 12px; }
.select { width: 100%; background: #fff; color: var(--tx); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px; font-family: inherit; font-size: 13px; margin: 6px 0; }
.slot-rows { display: flex; flex-direction: column; gap: 5px; }
.slot-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.slot-row label { color: var(--tx2); width: 64px; flex-shrink: 0; }
.slot-row select { flex: 1; background: #fff; color: var(--tx); border: 1px solid var(--line);
  border-radius: 6px; padding: 4px; font-family: inherit; font-size: 12px; }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.canvas-holder { display: flex; justify-content: center; width: 100%; }
#cv { max-height: calc(100vh - 200px); max-width: 100%; border-radius: 10px; background: #000;
  border: 1px solid var(--line); }
.transport { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 720px; }
.transport input[type=range] { width: 100%; accent-color: var(--acc); }
.scrub-wrap { position: relative; flex: 1; }
#scrubTicks { position: absolute; left: 0; right: 0; top: -7px; height: 7px; pointer-events: none; }
.scrub-tick { position: absolute; width: 3px; height: 100%; border-radius: 1px; transform: translateX(-50%); }
/* IN/OUT位置の🔻マーカー(バーの上に下向き三角で示す) */
.scrub-tick { width: 0; height: 0; background: none !important; border-left: 5px solid transparent;
  border-right: 5px solid transparent; border-top: 7px solid; border-radius: 0; }
.scrub-tick.start { border-top-color: var(--ok); }
.scrub-tick.end { border-top-color: var(--err); }
/* 区間の色帯(2026-08-01)。スライダーのすぐ下に敷き、押すとその場面へ飛ぶ。
   ★ pointer-events は auto。ticks と違ってこれは操作できる要素 */
/* ★ #trimBand(書き出し範囲の帯)は bottom:-5px 付近に居る。実測で
   範囲バンド 448px / 色帯 449px と**ほぼ同じ行に重なっていた** ─
   IN/OUT の旗が色帯を隠していた。色帯はさらに下へ逃がす(2026-08-01) */
.sec-band { position: absolute; left: 0; right: 0; bottom: -22px;
  width: 100%; height: 10px; border-radius: 3px; cursor: pointer;
  display: block; touch-action: manipulation; }
.sec-band[hidden] { display: none; }
/* 帯の凡例。色の意味が分からなければ帯はただの模様 */
.sec-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px;
  margin: 26px 0 0; font-size: 11px; color: var(--tx2); }
.sec-legend[hidden] { display: none; }
.sec-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sec-legend i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.time-label { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--tx2); white-space: nowrap; }
.trim-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trim-row .btn b { font-weight: 800; margin-left: 4px; letter-spacing: 0.04em; }
/* 書き出し範囲(IN〜OUT)をスライダー下に帯で見せる */
#trimBand {
  position: absolute; bottom: -7px; height: 5px; border-radius: 3px;
  background: var(--acc); opacity: 0.9; pointer-events: none;
}
#trimBand.full { opacity: 0.28; }
#trimBand .tb-flag {
  position: absolute; top: -3px; font-size: 8px; font-weight: 800;
  line-height: 1; color: #fff; background: var(--acc);
  padding: 2px 3px; border-radius: 3px; letter-spacing: 0.05em;
}
/* INは緑・OUTは赤で、どちらの旗か一目で分かるようにする(2026-07-21) */
#trimBand .tb-in { background: var(--ok); }
#trimBand .tb-out { background: var(--err); }
#trimBand.full .tb-flag { display: none; }
#trimBand .tb-in { left: 0; transform: translate(-2px, 8px); }
#trimBand .tb-out { right: 0; transform: translate(2px, 8px); }

.progress { margin-top: 8px; }
.progress-bar { height: 10px; background: rgba(15, 33, 56, 0.08); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .2s; }
.progress-text { font-size: 11px; color: var(--tx2); margin-top: 4px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--navy); color: #fff; border: none; padding: 10px 20px; border-radius: 24px;
  font-size: 13px; transition: .25s; opacity: 0; pointer-events: none; z-index: 99;
  /* ★ 幅を出し切ってから折り返す(2026-08-02 375px実測)。left:50%の収縮幅は
     親の半分で止まるため、長い文が187pxの縦長ピルになり語中で改行していた
     (「使え/ません」「写/真」)。max-contentで一旦広げ、92vwで畳む */
  width: max-content; max-width: min(92vw, 480px);
  box-shadow: 0 8px 32px rgba(15, 33, 56, 0.18); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
/* ★ 行動バーが出ているときは、その上へ逃がす(2026-08-03 2巡目レビュー実測)。
   選び直しの着地は「これでOK、おまかせを再開」を押してくださいと**名指しする**のに、
   トースト(2行・高さ59px)がその48ptの的を34px、3.5秒ぶん覆っていた。
   行動バーの高さ = 上下パディング10+10 + ボタン48 + safe-area */
body.mz-actionbar-on .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }


/* ============ 最初の選択フェーズ(つくる動画を選ぶ) ============ */
/* display:flex は UA の [hidden]=display:none を打ち消すため明示的に殺す */
.mode-select[hidden] { display: none; }
.mode-select { display: flex; justify-content: center; padding: 32px 16px; }
.mode-inner { width: 100%; max-width: 720px; text-align: center; }
/* 見出しは normal(≒1.18)だと2行に折り返した瞬間に詰まる */
.mode-title { font-size: 22px; font-weight: 700; color: var(--navy);
  line-height: 1.4; letter-spacing: 0.01em; }
.mode-lead { font-size: 13px; color: var(--tx2); margin-top: 6px; margin-bottom: 22px; }
/* ★ 見出し(と補足)との間に息を入れる(2026-08-07 優さん指示
   「作る動画をえらぶ、の下に少しマージンを」)。.mode-title も .mode-tip も
   下マージンを持たないため、カードが見出しに貼り付いていた。
   どちらが出ていても効くよう、余白はカード側が持つ */
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.mode-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  padding: 22px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-card); cursor: pointer; font-family: inherit; transition: .15s;
}
.mode-card:hover { border-color: var(--acc); transform: translateY(-2px); box-shadow: 0 6px 22px rgba(15,33,56,.12); }
.mode-card-icon {
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: #e8f1fe; color: var(--acc); margin-bottom: 4px;
}
.mode-card-name { font-size: 16px; font-weight: 700; color: var(--navy); }
/* ツール名(英)の下の日本語補足(2026-08-07 映像ツール再編)。desc より一段濃く */
.mode-card-sub { font-size: 12px; font-weight: 700; color: var(--tx2); }
.mode-card-desc { font-size: 12.5px; color: var(--tx2); line-height: 1.6; }

/* ============ 「こだわり」は登録した方から(2026-08-02 優さん指示) ============
   カードは消さずに鍵つきで見せる。押せば理由と次の一手が出る(下の .mode-flow-note)。
   薄くしすぎると「壊れている」に見えるので、色は落とさず鍵の札だけを足す */
.mode-card-lock {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: rgba(15, 33, 56, .07); color: var(--tx2);
  font-size: 11px; font-weight: 700; line-height: 1.7;
}
.mode-card-lock i { font-size: 10px; }
.mode-card--locked { box-shadow: none; border-color: var(--line); }
.mode-card--locked .mode-card-icon { background: rgba(15, 33, 56, .06); color: var(--tx2); }
.mode-card--locked:hover { border-color: var(--line); transform: none; box-shadow: none; }
/* 押したときの案内。断り文句で終わらせず、登録・ログインの2つを必ず出す */
.mode-flow-note {
  margin-top: 14px; padding: 14px 16px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.mfn-title { margin: 0 0 6px; font-size: 14px; font-weight: 800; color: var(--navy); }
.mfn-title i { color: var(--acc); margin-right: 6px; }
.mfn-body { margin: 0 0 12px; font-size: 12.5px; line-height: 1.7; color: var(--tx2); }
.mfn-btns { display: flex; flex-direction: column; gap: 8px; }
.mfn-go { min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; text-decoration: none; }

.mode-back-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px 0; }
.mode-back { background: none; border: none; color: var(--acc); font-size: 13px; cursor: pointer; font-family: inherit; padding: 4px 0; }
.mode-back:hover { color: var(--acc-deep); text-decoration: underline; }
.mode-current { font-size: 12px; color: var(--tx2); font-weight: 700; }
.mode-exit { margin-left: auto; min-height: 44px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); color: var(--tx2); font-family: inherit;
  font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; }
.mode-exit:hover { border-color: var(--acc); color: var(--navy); }

/* いま2段のどちらにいるか。2枚続けて選ばせるのに、
   何枚目なのかを言う場所が画面のどこにも無かった(2026-08-01) */
.mode-step-no {
  display: inline-block; margin-bottom: 10px; padding: 3px 11px;
  border-radius: 999px; background: rgba(30, 79, 214, .10);
  color: var(--acc); font-size: 11.5px; font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}

@media (max-width: 560px) {
  .mode-cards { grid-template-columns: 1fr; }
  .mode-select { padding: 24px 12px; }
}

/* ============ 仕上げの好み(2026-08-03 優さん承認案) ============
   おまかせで動画を選んだあとの1画面。おすすめが選択済みで出て、
   「このまま進む」1タップで自走が始まる(旧 .wipe-pick を統合・置き換え)。
   全画面の作法(flex-start+margin:auto・safe-area・背後の固定)は .auto-stage と同じ */
/* ★ 下パディングは持たない(2026-08-03 2巡目レビュー実測)。sticky の .wp-foot は
   **スクロールポートのパディング箱**に貼り付くので、ここに 24px を置くと
   フッタの下端が画面下端の24px上で止まり、その窓から下の中身(色カード)が
   フェードも無しに生で覗いていた(実測: footBottom 529 / 画面 553、
   隙間のヒットテスト=fp-colors)。下の余白と safe-area は .wp-foot が受け持つ ─
   容器と両方で env() を取ると実機で二重取りになり、ボタンが 34px 余計に浮く */
.finish-pick { position: fixed; inset: 0; z-index: 130;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px))
           calc(16px + env(safe-area-inset-right, 0px))
           0
           calc(16px + env(safe-area-inset-left, 0px));
  overflow-y: auto; }
.finish-pick[hidden] { display: none; }
html:has(body.mz-finish-pick), body.mz-finish-pick {
  overflow: hidden !important; height: 100%;
}
.wp-inner { width: 100%; max-width: 520px; margin: auto; text-align: center; }
.wp-kind { margin: 0 0 4px; color: var(--acc); font-size: 11.5px; font-weight: 800;
  letter-spacing: .08em; }
/* 選択のまとまり(配置/切り替え/色)。左寄せ+小さな見出しで縦のリズムを作る */
.fp-sec { margin-top: 18px; text-align: left; }
.fp-sec-title { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--navy); }
.fp-hint { margin: -4px 0 8px; font-size: 12px; color: var(--tx2); }
.wp-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
.wp-card { display: flex; align-items: center; gap: 12px; text-align: left;
  /* min-width:0 が無いとグリッドの 1fr が nowrap のファイル名より縮めず、
     長い名前のとき 375px で横スクロールになる(2026-08-02 レビュー実測で発見) */
  min-width: 0;
  padding: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-card);
  /* ★ cursor:pointer と :hover の青枠は外した(2026-08-04 レビュー)。
     カードは <button> をやめて器になったので、全体が押せそうに見えるのは嘘。
     押せるのは中の .fp-role だけ */
  font-family: inherit; transition: .15s; }
.wp-card--main { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc) inset; }
.wp-thumb-wrap { position: relative; flex: 0 0 96px; }
.wp-thumb { display: block; width: 96px; height: 56px; object-fit: cover;
  border-radius: 9px; background: #15171d; }
.wp-thumb--empty { background: #d9dfe8; }
.wp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wp-name { min-width: 0; font-size: 13px; font-weight: 600; color: var(--navy);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-meta { font-size: 11.5px; color: var(--tx2); font-variant-numeric: tabular-nums; }
/* 帯/役の札。割り当て済み=塗り、選び直し中の未定=点線の「？」 */
/* 旧「役の札」(.fp-chip)は撤去。役はカードごとの .fp-role で直接押す(2026-08-04) */
.fp-seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.fp-seg--2 { grid-template-columns: 1fr 1fr; }
/* 貼り付いたフッタの上に薄いぼかしを敷き、下に続きがあることを見せる(2026-08-04) */
.wp-foot::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
  height: 16px; pointer-events: none;
  background: linear-gradient(to top, #eef2f8, rgba(238,242,248,0)); }
/* 役の札(2026-08-04)。カードごとに「上/中/下」を直接押して入れ替える。
   どれか1つが必ず点いていて、押した瞬間に入れ替わりが完了する */
.fp-roles { flex: 0 0 auto; display: flex; gap: 6px;
  /* 5択化(2026-08-04)で札が6枚になった。1行に収まらない幅では折り返す */
  flex-wrap: wrap; }
/* 2軸プルダウン(2026-08-05 優さん指示)。被写体×固定or手持ち */
.fp-axes { flex: 0 0 auto; display: flex; gap: 6px; flex-wrap: wrap; }
.fp-axis { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fp-axis-label { font-size: 11px; font-weight: 700; color: var(--tx2); padding-left: 2px; }
.fp-axis-sel { min-height: 44px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--navy); font-size: 13px; font-weight: 700;
  padding: 0 8px; }
@media (max-width: 460px) {
  .fp-axes { flex: 1 0 100%; }
  .fp-axis { flex: 1; }
  .fp-axis-sel { width: 100%; min-width: 0; }
  /* iOS Safari は16px未満の select にフォーカスすると画面を自動ズームし、
     閉じても拡大が残る(2026-08-05 レビューP1)。スマホ幅では16pxにする */
  .fp-axis-sel, .select-mini { font-size: 16px; }
}
.fp-role { min-height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--tx2);
  font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fp-role:hover { border-color: var(--acc); }
.fp-role.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc) inset;
  color: var(--navy); background: var(--panel); }
/* 狭い画面では札を2段目へ回して、横に潰さない(6枚=3枚×2段) */
@media (max-width: 460px) {
  .wp-card { flex-wrap: wrap; }
  .fp-roles { flex: 1 0 100%; }
  .fp-role { flex: 1 1 30%; padding: 0 4px; }
}
.fp-seg-btn { min-height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow-card); font-family: inherit;
  font-size: 13px; font-weight: 700; color: var(--navy); cursor: pointer; transition: .15s; }
.fp-seg-btn:hover { border-color: var(--acc); }
/* ★ 選択中の描き方を1画面で2通りにしない(2026-08-07 UI/UXレビュー🟡)。
   同じ #finishPick の中で 色(.fp-color.on)には右上にチェック丸が出るのに、
   切り替え/傾き(.fp-seg-btn.on)は枠と文字色だけだった ─ 「チェックが付いて
   いるのが選択中」と学習した直後に、チェックの無い列が出てくる。
   枠だけの表現はiPhoneの屋外でいちばん見落とされる */
.fp-seg-btn.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc) inset;
  color: var(--acc); position: relative; font-weight: 700; }
.fp-seg-btn.on::after {
  content: ""; position: absolute; top: 6px; right: 8px;
  width: 6px; height: 10px; border: solid var(--acc);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
/* 色: 2枚のカード。選択は枠+右上のチェックで言う(色は絵の話なので文字を増やさない) */
.fp-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* 使う音(2026-08-06 優さん実機指示)。おまかせ既定+行ごとに試聴 */
.fp-audio { display: flex; flex-direction: column; gap: 6px; }
.fp-audio-row { display: flex; align-items: stretch; gap: 6px; }
.fp-audio-pick {
  position: relative; flex: 1; min-width: 0; text-align: left;
  min-height: 44px; padding: 8px 34px 8px 12px;
  border: 1.5px solid var(--line, #d7dbe3); border-radius: 12px;
  background: #fff; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.fp-audio-row.on .fp-audio-pick { border-color: var(--sel-ring); background: var(--sel-bg); }
.fp-audio-row.on .fp-audio-pick { box-shadow: inset 0 0 0 1px var(--sel-ring); }
.fp-audio-name { font-weight: 800; font-size: 14px; color: var(--navy, #101a3a); }
.fp-audio-sub { font-size: 11px; color: var(--muted, #667085); }
.fp-audio-pick .fp-check { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  opacity: 0; color: var(--acc, #2440c8); }
.fp-audio-row.on .fp-audio-pick .fp-check { opacity: 1; }
.fp-audio-play {
  flex: none; min-width: 84px; min-height: 44px; padding: 8px 10px;
  border: 1.5px solid var(--line, #d7dbe3); border-radius: 12px;
  background: #fff; cursor: pointer; font-size: 12px; font-weight: 700;
  color: var(--navy, #101a3a); display: inline-flex; align-items: center;
  justify-content: center; gap: 5px;
}
.fp-audio-play.on { border-color: var(--sel-ring); color: var(--sel-ring); background: var(--sel-bg); }
.fp-audio-play.on { box-shadow: inset 0 0 0 1px var(--sel-ring); }

.fp-color { position: relative; text-align: left; min-height: 44px;
  padding: 12px 12px 10px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow-card); font-family: inherit;
  cursor: pointer; transition: .15s; }
.fp-color:hover { border-color: var(--acc); }
.fp-color.on { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc) inset; }
.fp-color-name { display: block; font-size: 13px; font-weight: 700; color: var(--navy);
  padding-right: 18px; }
.fp-reco { margin-left: 6px; font-size: 10px; font-weight: 700; color: var(--acc);
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 6px;
  vertical-align: 1px; white-space: nowrap; }
.fp-color-desc { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.5;
  color: var(--tx2); }
.fp-check { position: absolute; top: 10px; right: 10px; color: var(--acc);
  opacity: 0; transition: .15s; }
.fp-color.on .fp-check { opacity: 1; }
/* 戻る(#fpBack)は左端(2026-08-02 優さん指示⑨の作法を継ぐ)。進むは右で大きく。
   ★ 画面下に貼り付ける(2026-08-03 レビュー実測)。縦型・ワイプの3本は中身が
     648px あり、iPhone SE クラス(375×553)では「このまま進む」が折り目の
     71px 下に落ちていた ─ 1タップで自走が始まることだけが存在理由の画面で、
     その的が初期表示に無いのは哲学が効いていないのと同じ。
     上のフェードで「まだ下に続く」ことも同時に言う(.finish-pick の背景と同色) */
.wp-foot { position: sticky; bottom: 0; z-index: 1; background: #eef2f8;
  margin-top: 20px;
  /* 下の余白と safe-area はここだけが持つ(容器と二重に取らない・上のコメント参照) */
  padding: 12px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: stretch; gap: 10px; }
/* 上のフェード。20px だと見出し「色」のちょうど真ん中に落ちて
   文字が半分だけ薄く見えるので、行を丸ごと送れる 32px にする(2巡目レビュー) */
.wp-foot::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
  height: 32px; pointer-events: none;
  background: linear-gradient(180deg, rgba(238,242,248,0) 0%, #eef2f8 100%); }
.wp-foot #fpBack { min-height: 44px; }   /* .btn.small のままでは指の的が細すぎる */
.wp-foot #fpGo { flex: 1; min-height: 48px; font-size: 14px; }
/* ★ ここも opacity をやめる(2026-08-07)。.btn:disabled と同じ理由 ─
   仕上げ画面の主ボタン「このまま進む」がラベルごと薄まっていた */
.wp-foot #fpGo:disabled { cursor: default; background: var(--off-primary-bg);
  color: var(--off-primary-tx); border-color: var(--off-line); box-shadow: none; }
@media (max-width: 355px) {
  .fp-colors { grid-template-columns: 1fr; }   /* 320px はカードを縦積みに */
}

/* ============ タイムライン(スイッチング/ワイプ) ============ */
.timeline-wrap { width: 100%; max-width: 720px; }
.tl-strip { position: relative; height: 44px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; touch-action: none; }
.tl-block { position: absolute; top: 0; height: 100%; opacity: .85; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-right: 1px solid rgba(255,255,255,.55); }
.tl-block.selected { opacity: 1; outline: 2px solid var(--navy); outline-offset: -2px; z-index: 2; }
.tl-label { font-size: 11px; font-weight: bold; color: rgba(255,255,255,.95); pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; }
.tl-handle { position: absolute; left: -7px; top: 0; width: 14px; height: 100%; cursor: ew-resize; z-index: 3; }
.tl-handle::after { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: rgba(255,255,255,.85); border-radius: 1px; }
.tl-head { position: absolute; top: 0; width: 2px; height: 100%; background: var(--navy); z-index: 4; pointer-events: none; }
.tl-toolbar { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* ============ モバイル(iPhone優先): 1カラム・プレビュー先頭・タッチ配慮 ============ */
@media (max-width: 900px) {
  body { font-size: 15px; }
  .wrap { flex-direction: column; padding: 10px; gap: 10px; }
  .stage { order: -1; width: 100%; }
  .side { width: 100%; }
  #cv { max-height: 35vh; }   /* 初期プレビューは画面の1/3強(2026-07-24 優さん指示で2/3に縮小) */
  .topbar { padding: 8px 12px; }
  .mz-logo { height: 28px; }
  .tool-name { font-size: 13px; padding-left: 8px; }
  /* ★ すべてのボタンに 44pt を保証する(2026-08-01 優さん実機指摘
     「ボタンのレイアウト気をつけて」)。実測375pxで #audioDecideBtn が
     42px と、主ボタンなのに小ボタン(44px保証済み)より低かった */
  .btn { padding: 11px 16px; min-height: 44px; }
  /* IN/OUT・試聴・記録のコピー等。長すぎて書き出せないときの逃げ道が
     この小ボタンなので、親指で外さない大きさを確保する(2026-07-26) */
  .btn.small { padding: 8px 12px; font-size: 12px; min-height: 44px; }
  .btn.round { width: 52px; height: 52px; }
  .nudge button { padding: 6px 8px; font-size: 12px; }
  .dropzone { padding: 16px; }
  .transport, .trim-row { max-width: 100%; }
  input[type=range] { min-height: 32px; }  /* タッチしやすく */
  /* iOS Safariはfont-size<16pxのselect/inputフォーカスでページをズームするため16px固定 */
  .wrap select, .wrap input[type="number"] { font-size: 16px; }
}
/* iOSセーフエリア */
@supports (padding: env(safe-area-inset-bottom)) {
  .wrap { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ベータ免責バナー(Reangle/Privacy と共通のトーン) */
.beta-disclaimer {
  margin: 0; padding: 8px 16px; font-size: 12px; line-height: 1.5;
  color: #876b3a; background: #fbf6e6; border-bottom: 1px solid #eadfbf; text-align: center;
}
.beta-disclaimer i { margin-right: 2px; }

/* フッタ+ツール間の連続導線(v2026-07-18レビュー反映) */
footer { text-align: center; padding: 16px calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)); font-size: 11px; color: var(--sub, rgba(12, 15, 20, 0.55)); }
footer .foot-link { color: #1e4fd6; }
.foot-tools { margin-top: 4px; }
.foot-tools a { color: #1e4fd6; text-decoration: none; }
.foot-tools a:hover { text-decoration: underline; }

/* 管理者ログイン中の上限なし表示 */
.admin-limit-badge {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px;
  background: rgba(37, 99, 235, 0.08); border: 1px solid rgba(37, 99, 235, 0.25);
  color: #1d4ed8; font-size: 12px; line-height: 1.6; font-weight: 700;
}

/* ベータ免責の開閉(1行要約+タップで詳細) */
.beta-disclaimer .disc-more { display: inline; }
.beta-disclaimer .disc-more summary {
  display: inline; cursor: pointer; color: inherit;
  text-decoration: underline; font-weight: 600; padding: 8px 2px;   /* タップしやすく */
}

/* 切替頻度(1〜5)のセグメントコントロール */
.level-row { align-items: center; }
.level-seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; }
.level-seg button {
  min-width: 34px; padding: 6px 14px; border: none; border-radius: 8px;
  background: transparent; color: var(--tx2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s;
}
.level-seg button.selected { background: var(--acc); color: #fff; }
.level-seg button:not(.selected):hover { background: rgba(15, 33, 56, 0.06); }

/* クリップカードの役割タグ */
.select-mini {
  background: var(--panel2); color: var(--tx); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 6px; font-size: 12px; max-width: 150px;
}

/* ジャーニーバーの現在フェーズに対応するセクションの控えめな強調 */
.side .panel { transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.side .panel.phase-current {
  border-color: rgba(30, 79, 214, 0.45);
  box-shadow: 0 0 0 1px rgba(30, 79, 214, 0.18), var(--shadow-card);
}


/* ジャーニーバー(sticky)に見出しが隠れないスクロール余白 */
.side .panel { scroll-margin-top: 96px; }

/* タップ目標の底上げ(iOS) */
.nudge button { min-height: 34px; }
.select-mini { min-height: 32px; }

/* iPhone: ダブルタップズームの誤発火を防ぐ(スクロール/ピンチは妨げない) */
button, select, input, label, .btn { touch-action: manipulation; }

/* ============ ボトムアクションバー(モバイル): 親指ゾーンに「次の一手」 ============ */
/* 親指バーの高さ。中断ノートは body 直下の兄弟なので、変数は body 側に置く
   (カスタムプロパティは子孫にしか継承されない)。1箇所で持つ(2026-07-25)。
   以前は .mz-interrupt-note 側にも 69px が直書きされ、二重管理だった */
body { --mz-actionbar-h: 69px; }

.mz-actionbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;   /* MZPドック(90)の下: 進捗表示中はドックに譲る(下の mzp-docked で畳む) */
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line);
}
.mz-actionbar button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;   /* 親指目標 */
}
@media (max-width: 900px) {
  .mz-actionbar.on { display: block; }
  .wrap { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- おまかせ / こだわり タブ(2026-07-19) ---- */
.setup-tabs { display: flex; flex-direction: column; gap: 10px; }
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
}
.tabs .tab {
  flex: 1; padding: 10px 12px; font-size: 14px; font-weight: 700;
  color: var(--tx2); background: transparent; border: 0; border-radius: 9px; cursor: pointer;
}
.tabs .tab.on { color: #fff; background: var(--acc); }
.easy-pane {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.easy-lead { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--tx); }
.btn.big { padding: 15px; font-size: 16px; }
.pro-pane { display: flex; flex-direction: column; gap: 12px; }

/* ---- エラーログ(利用者がコピーして知らせられるように) ---- */
/* 失敗したときのログと脱出口の置き場。工程パネルの外に出したので、
   中身が両方隠れているときに余白だけ残らないようにする */
.trouble-box:not(:has(> *:not([hidden]))) { display: none; }
.trouble-box { margin: 0 0 4px; }

.error-log { margin-bottom: 10px; }
.error-log summary { cursor: pointer; font-size: 13px; font-weight: 700; color: #b4441f; }
.error-log pre {
  max-height: 220px; overflow: auto; margin: 8px 0;
  padding: 10px; font-size: 11px; line-height: 1.6;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  white-space: pre-wrap; word-break: break-word; user-select: text;
}

/* ---- 下へスクロールしてもプレビューは上に残す(2026-07-19) ---- */
@media (min-width: 861px) {
  .stage { position: sticky; top: 8px; align-self: flex-start; }
}
@media (max-width: 860px) {
  /* スマホ: プレビュー(canvas+操作)だけを画面上部へ貼り付ける */
  .stage { position: sticky; top: 0; z-index: 30; background: var(--bg); padding-top: 6px; }
  .stage .timeline-wrap { position: static; }
}

/* タイムラインのカメラ切替(2026-07-20: 順送りボタンから直接選択へ) */
.tl-toolbar .tl-info { display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.tl-toolbar .tl-info strong { font-size: 12.5px; }
.tl-info-sub { color: var(--tx2, rgba(12, 15, 20, 0.65)); font-variant-numeric: tabular-nums; }

/* 操作の説明(タップ2回で確定)。触る前に何が起きるか分かるようにする */
.tl-info-help {
  color: var(--tx2, rgba(12, 15, 20, 0.65));
  font-size: 11.5px;
  line-height: 1.45;
}

.tl-cam-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-cam {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;            /* iPhone のタップ標的 */
  padding: 6px 10px;
  border: 1px solid rgba(15, 33, 56, 0.16);
  border-radius: 10px;
  background: #fff;
  color: var(--tx, #0c0f14);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.tl-cam .tl-cam-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--cam, #999);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.tl-cam.on {
  border-color: var(--acc, #1e4fd6);
  background: rgba(30, 79, 214, 0.08);
  box-shadow: inset 0 0 0 1px var(--acc, #1e4fd6);
}
.tl-cam.on .tl-cam-name { color: var(--acc, #1e4fd6); }
.tl-cam.armed {
  border-color: var(--acc2-text, #b45309);
  background: rgba(180, 83, 9, 0.1);
  color: var(--acc2-text, #b45309);
}
.tl-cam.armed .tl-cam-name { color: var(--acc2-text, #b45309); font-weight: 800; }


/* ============ 2026-07-21 スマホUI/UX改修 ============ */

/* ---------- IN/OUTボタン(色分け・テキストはIN/OUTのみ) ---------- */
.trim-btn { font-weight: 800; letter-spacing: 0.04em; }
.trim-btn .trim-tri { font-size: 9px; margin-right: 1px; }
.trim-btn--in { color: var(--ok); border-color: var(--ok); }
.trim-btn--in:hover { background: rgba(30, 122, 67, 0.08); }
.trim-btn--out { color: var(--err); border-color: var(--err); }
.trim-btn--out:hover { background: rgba(192, 57, 43, 0.08); }

/* ---------- スマホ: プレビューを画面上1/3へピン留め ----------
   旧: 右上の小窓フロート(29vw)。実機で小さすぎ+サイトヘッダーへ重なり破綻
   (2026-07-24 優さん指示で廃止)。代わりに、スクロールでプレビューが見えなく
   なったら画面上部へ全幅・約1/3高で固定する。傾き調整中(mz-pin-force)も固定 */
@media (max-width: 860px) {
  body.mz-has-clips.mz-pin-on:not(.cutmode-open) .canvas-holder,
  body.mz-has-clips.mz-pin-force:not(.cutmode-open) .canvas-holder {
    position: fixed;
    /* ジャーニーバー(進捗)の真下。高さは journey.js が --mz-journey-h に実測値を入れる */
    top: calc(var(--mz-journey-h, 72px) + env(safe-area-inset-top, 0px));
    left: 0; right: 0;
    height: 30vh;
    z-index: 55;   /* ジャーニーバー(60)より下 */
    display: flex; align-items: center; justify-content: center;
    padding: 6px;
    background: rgba(8, 12, 18, 0.97);
    box-shadow: 0 10px 24px rgba(8, 12, 18, 0.35);
  }
  body.mz-has-clips.mz-pin-on:not(.cutmode-open) .canvas-holder #cv,
  body.mz-has-clips.mz-pin-force:not(.cutmode-open) .canvas-holder #cv {
    max-height: 100%; max-width: 100%; width: auto;
    border-radius: 8px; border: 0;
  }
  body.mz-has-clips.mz-pin-on:not(.cutmode-open) .canvas-holder { cursor: pointer; }
  body.mz-has-clips.mz-pin-force:not(.cutmode-open) .canvas-holder { cursor: pointer; }

  /* 全画面: タップで開く。閉じるボタンで戻る。サイトヘッダーやドロワー(〜120)より
     必ず手前になるよう z-index を大きく取る(2026-07-24 実機でヘッダー被り発覚) */
  body.mz-has-clips:not(.cutmode-open) .canvas-holder.float-full {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 300;
    border-radius: 0;
    background: rgba(8, 12, 18, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
    cursor: default;
  }
  body.mz-has-clips:not(.cutmode-open) .canvas-holder.float-full #cv {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    border: 0;
    border-radius: 10px;
  }
  /* 全画面の間は、上に貼り付くジャーニーバーとボトムバーを引っ込める */
  body.mz-float-full .mzj,
  body.mz-float-full .mz-actionbar,
  body.mz-float-full .mzp-dock { display: none !important; }
  /* 全画面中は本文スクロールを完全に止める(bodyを固定。topはJSが現在位置を入れる)
     (2026-07-24 優さん指示: 下がスクロールできて透けていた) */
  body.mz-float-full {
    position: fixed;
    left: 0; right: 0; width: 100%;
    overflow: hidden;
  }

  body.mz-has-clips:not(.cutmode-open) .canvas-holder.float-full .float-close {
    display: grid; place-items: center;
    position: fixed;
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 10px;
    width: 46px; height: 46px; border-radius: 50%;
    border: 0; background: rgba(255, 255, 255, 0.16); color: #fff;
    font-size: 20px; z-index: 301;
  }
  .canvas-holder { position: relative; }
  .float-close { display: none; }
  .stage { position: static; padding-top: 0; }
}

/* ---------- カット切替モード(全画面) ---------- */
.cutmode-btn { width: 100%; justify-content: center; font-weight: 700; }
.cut-modal {
  position: fixed; inset: 0; z-index: 110;
  background: var(--bg, #f4f6fa);
  display: flex; flex-direction: column; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.cm-head { display: flex; align-items: center; gap: 10px; }
.cm-counter { font-weight: 800; font-size: 15px; }
.cm-time { font-size: 12px; color: var(--tx2); font-variant-numeric: tabular-nums; }
.cm-close { margin-left: auto; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 16px; }
.cm-stage { display: flex; justify-content: center; }
.cm-stage .canvas-holder { width: auto; max-width: 100%; }
.cm-stage #cv { max-height: 38vh; max-width: 100%; }
.cm-nav { display: flex; gap: 8px; }
.cm-nav-btn { flex: 1; justify-content: center; min-height: 46px; font-weight: 700; }
.cm-hint { margin: 0; font-size: 12px; color: var(--tx2); text-align: center; }
.cm-cams { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cm-cam {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 8px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700;
}
.cm-cam .cm-cam-no {
  display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--cam, #888); color: #fff; font-size: 12px;
}
.cm-cam.on { border-color: var(--cam, var(--acc)); background: rgba(30, 79, 214, 0.06); }
.cm-cam.on .fa-check { color: var(--ok); }
.cm-list {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.cm-item {
  position: relative; flex: 0 0 auto; width: 96px; height: 54px;
  border: 2px solid var(--cam, var(--line)); border-radius: 8px; overflow: hidden;
  background: #dfe4ec; padding: 0; scroll-snap-align: center;
}
.cm-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-item-ph { display: block; width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg, #dfe4ec, #dfe4ec 8px, #d3d9e3 8px, #d3d9e3 16px); }
.cm-item-no {
  position: absolute; left: 4px; top: 3px; font-size: 10px; font-weight: 800;
  color: #fff; background: rgba(8, 12, 18, 0.6); border-radius: 4px; padding: 1px 5px;
}
.cm-item.on { outline: 3px solid var(--acc); outline-offset: 1px; }

/* ---------- おまかせ → 動画を書き出す(状態でボタンが化ける) ---------- */
#easyStartBtn.export-ready {
  background: var(--ok);
  border-color: var(--ok);
}
#easyStartBtn.export-ready:hover { filter: brightness(1.08); }


/* 横スクロールの防止(2026-07-21 実機で画面が右にずれる事象)。
   clip は sticky を壊さない(hidden だと journey/stage の sticky が効かなくなる) */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }
}


/* 書き出せない長さの案内(おまかせ完了直後に出す) */
.mz-export-warn {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--warn, #9a6a00);
  border-radius: 12px;
  background: #fffaf0;
}
.mz-export-warn .mzw-title { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--warn, #9a6a00); }
.mz-export-warn .mzw-body { margin: 0 0 10px; font-size: 12.5px; line-height: 1.6; color: var(--tx2); }
.mz-export-warn .btn { width: 100%; justify-content: center; }

/* 取り込み後に運んだ先を一瞬だけ光らせる(どこへ来たか分かるように) */
@keyframes mzFocusFlash {
  0% { box-shadow: 0 0 0 0 rgba(30, 79, 214, 0.45); }
  100% { box-shadow: 0 0 0 14px rgba(30, 79, 214, 0); }
}
.mz-focus-flash { animation: mzFocusFlash 1.2s ease-out; }


/* ---------- ゲストの「こだわり」ロック(2026-07-21) ---------- */
/* 見えるが触れない。何が待っているかは分かるようにする */
.mz-locked {
  opacity: 0.5;
  user-select: none;
  cursor: pointer;   /* タップすると「登録で使えます」の案内を返す(2026-07-23 A-2) */
}
.mz-locked > *:not(h2) { pointer-events: none; }
.mz-pro-lock-note {
  padding: 12px 14px;
  border: 1px solid rgba(30, 79, 214, 0.3);
  border-radius: 12px;
  background: #eef3ff;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--navy);
}
.mz-pro-lock-note a { font-weight: 700; }


/* ---------- 「このまま待ってて」まわり(2026-07-21) ---------- */
/* 取り込む前の予告。目立たせすぎず、でも読み飛ばされない位置に */
.mz-stay-hint {
  margin: 6px 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(217, 119, 6, 0.08);
  color: #8a5a04;
  font-size: 12px;
  line-height: 1.7;
}
.mz-stay-hint i { margin-right: 3px; }

/* 作業中の帯。下端に静かに出す(ボトムバーは作業中は消える仕様なので重ならない) */
.mz-stay-banner {
  position: fixed;
  left: 10px; right: 10px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));  /* 進捗ミニバーの上 */
  z-index: 85;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 33, 56, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 6px 20px rgba(8, 12, 18, 0.25);
  animation: mzStayIn 0.3s ease-out;
  pointer-events: none;    /* 下の操作を邪魔しない */
}
.mz-stay-banner i { color: #f5c518; margin-right: 4px; }
@keyframes mzStayIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }


/* ---------- 書き出しの所要時間の目安 / プロジェクトリセット(2026-07-21) ---------- */
.export-eta-hint { margin: 6px 0 0; font-size: 12px; color: var(--tx2); }

/* ============ 完了・書き出しまわりのボタン(2026-08-01 優さん実機指摘
   「ボタンのレイアウト気をつけて」) ============ */
/* 主ボタンは行いっぱいに。実測375pxで「動画を書き出す」が 160px しかなく、
   いちばん大事なボタンが目測で探すものになっていた(中止が出たら2分割になる) */
#exportBtn { flex: 1 1 auto; }
/* ★ 完了カード(パネル側)は保存とダウンロードを縦に積む。
   実測375pxで 保存125px・ダウンロード148px が 8px 差で横に並び、
   ・主ボタン(保存)が副ボタンより**狭い**＝視覚的な重みが逆
   ・違う結果になる2つが親指1本ぶんの距離＝押し間違えの筆頭
   だった。全画面の完了(#eoDone .eo-actions)は最初から縦積み・主が上・
   副は静かな文字ボタンで、同じ内容の2画面で並びだけ違う理由も無い。
   こちらも同じ形に揃える */
#doneCard .row { flex-direction: column; gap: 10px; }
#doneCard .row .btn { width: 100%; }
/* 副ボタンは全画面側の「ダウンロード」(.eo-dl=ghost)と同じ静かな顔に */
#downloadBtn { font-size: 13px; opacity: .85; background: none; padding: 11px 15px; }
/* ★ 保存ボタンの中身はアイコン込みで中央(2026-08-01 優さん指摘
   「保存するのテキストは中央そろえ」)。showDone が display:inline-flex を
   インラインで当てるため、justify-content が無いと左端に寄っていた */
.eo-actions .btn, #doneCard .row .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
/* ★ 保存できた顔(2026-08-01 優さん指示「保存完了ももっとわかりやすく」)。
   主ボタンが緑の「✓ 保存しました」に変わり、下に緑の帯が入る ─
   文字を足さずに、画面の主役の色で言う */
.btn.primary.saved { background: var(--ok); }
/* ★ 保存できた瞬間、主ボタンがぽんと弾む(2026-08-02 優さん指示「保存時のUIを楽しく」)。
   派手さより気持ちよさ ─ 6%膨らんで97%へ沈み、戻る。0.5秒で終わる */
@keyframes mzSavedPop {
  0% { transform: scale(1); } 35% { transform: scale(1.06); }
  65% { transform: scale(.97); } 100% { transform: scale(1); }
}
.btn.primary.saved { animation: mzSavedPop .5s cubic-bezier(.2, .8, .3, 1.2); }
@media (prefers-reduced-motion: reduce) { .btn.primary.saved { animation: none; } }
.eo-note.save-ok, .status.save-ok {
  background: rgba(30, 122, 67, .12); color: var(--ok);
  font-weight: 700; padding: 10px 12px; border-radius: 10px;
}

/* ============ 別のシーンも作る(2026-08-01 UI/UXレビュー) ============
   エンジニアが構造だけ置いた部分(mzso-*)の整え。実測375pxで素のUAボタン
   (Arial 13.3px・高さ24px・OS灰色・間隔0)のままで、
   ・24px はタップ目標44ptの半分近く
   ・保存(323x54)の直下にOS標準の顔が並び、別の製品の画面に見えた。
   1行=候補1つ(アイコン+名前+「何分何秒〜」を右寄せ)にする ─
   おまかせ全画面の段リストと同じ「名前+値」の文法。
   2列グリッドは「ドラムライン 4分10秒〜」(実測162px)が半列(約160px)に
   収まらないので選ばない */
.mz-scene-offers { margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line); text-align: left; }
.mzso-title { margin: 0 0 9px; font-size: 13.5px; font-weight: 700; color: var(--tx); }
.mzso-title i { color: var(--acc); margin-right: 5px; }
.mzso-note { display: block; margin-top: 2px; font-size: 11.5px;
  font-weight: 500; color: var(--tx2); }
.mzso-list { display: flex; flex-direction: column; gap: 8px; }
.mzso-btn { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px;
  padding: 10px 14px; font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--navy); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; text-align: left; }
.mzso-btn i { color: var(--acc); width: 16px; text-align: center; flex: none; }
/* シーン候補の小さなサムネイル(2026-08-04)。開始時点の全景カメラの絵。
   絵が入るまでは枠だけ出す ─ 入った瞬間に行の高さが変わると、
   読んでいる最中に候補が飛ぶ(先に場所を取っておく) */
.mzso-thumb { flex: none; width: 48px; height: 27px; border-radius: 4px;
  background: var(--line); background-size: cover; background-position: center; }
.mzso-thumb.has-img { background-color: transparent; }
.mzso-btn:active { transform: scale(.98); }
.mzso-btn:hover { border-color: var(--acc); }
.mzso-t { margin-left: auto; padding-left: 8px; flex: none;
  font-size: 12px; font-weight: 600; color: var(--tx2);
  font-variant-numeric: tabular-nums; }
/* ★ 保存が済むまでは候補を畳む(2026-08-02 優さん実機指摘「別のシーンのボタンを
   押してしまう。一旦保存させるように」)。候補を押すと次の書き出しが始まり、
   いま作った動画は失われる ─ 誤タップの代償がいちばん大きい場所。
   畳んだ状態では扉が1枚だけ(=誤タップの的が5個から1個になる)、
   その1枚も「保存せずに」と名乗るので、押した人は何をしているか分かる */
.mz-scene-offers.mzso-hold { opacity: .72; }
.mz-scene-offers.mzso-hold .mzso-title { font-weight: 600; }
.mz-scene-offers.mzso-hold .mzso-note { color: var(--acc2); font-weight: 700; }
.mzso-reveal { display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; padding: 10px 14px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--tx2); background: none; border: 1px dashed var(--line);
  border-radius: 10px; cursor: pointer; }
.mzso-reveal i { color: var(--tx2); }
.mzso-reveal:active { transform: scale(.98); }
/* ★ ゲストが1本使い切ったあとの登録の誘い(2026-08-02 ⑭)。責めずに1行+1ボタン */
.mzso-signup { display: flex; align-items: center; justify-content: center;
  min-height: 44px; margin-top: 4px; border: 1px solid rgba(30, 79, 214, .35);
  border-radius: 10px; color: var(--acc); font-size: 13.5px; font-weight: 700;
  text-decoration: none; background: rgba(30, 79, 214, .05); }
.mzso-signup:active { transform: scale(.98); }
/* 押せない理由の説明。11pxの薄いhintでは、ブロックの理由を伝える文として弱い */
.audio-gate-hint { margin-top: 10px; padding: 9px 11px; font-size: 12.5px; line-height: 1.6;
  color: var(--tx2); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.audio-gate-hint i { color: var(--acc2); margin-right: 5px; }

.project-reset { margin-top: 10px; width: 100%; justify-content: center; color: var(--tx2); }
.project-reset:hover { color: var(--err); border-color: var(--err); }


/* 前回の続きから始められることを画面に残す(2026-07-21 レビュー指摘) */
.mz-restore-note {
  margin: 6px 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(30, 122, 67, 0.08);
  color: #14603a;
  font-size: 12px;
  line-height: 1.7;
}
.mz-restore-note i { margin-right: 4px; }


/* ---------- 全画面の閉じるボタンは全画面中だけ(2026-07-24 ピン化で整理) ---------- */
@media (max-width: 860px) {
  body.mz-has-clips:not(.cutmode-open) .canvas-holder.float-full .float-close {
    display: inline-flex;
  }
}

/* 素材を入れた直後の所要時間の目安(分析→書き出しの2段) */
.total-eta-hint {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(30, 79, 214, 0.22);
  border-radius: 10px;
  background: #f4f7ff;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--tx);
}
.total-eta-hint i { color: var(--acc); margin-right: 4px; }
.total-eta-hint b { font-weight: 800; color: var(--acc-deep); }
.total-eta-sub {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--tx2);
}


/* ---------- 書き出し画質の選択(2026-07-23) ---------- */
.quality-picker { display: grid; gap: 8px; margin-bottom: 10px; }
.q-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; text-align: left; font-family: inherit;
}
.q-card.on { border-color: var(--sel-ring); background: var(--sel-bg);
  box-shadow: inset 0 0 0 1px var(--sel-ring), 0 1px 3px rgba(30, 79, 214, 0.14); }
.q-name { font-size: 13.5px; font-weight: 800; color: var(--tx); }
.q-tag {
  font-style: normal; font-size: 11px; font-weight: 800;
  padding: 2px 9px; border-radius: var(--r-pill); vertical-align: 1px;
  background: #e8f1fe; color: var(--acc-deep);
}
.q-card.on .q-name { color: var(--acc-deep); }
.q-desc { font-size: 11.5px; color: var(--tx2); }

/* ---------- 縦型: カメラの配置(上/中/下) ---------- */
.place-rows { display: grid; gap: 6px; }
.place-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel2);
}
.place-pos {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--acc); color: #fff; font-weight: 800; font-size: 14px;
}
.place-thumb { width: 46px; height: 30px; object-fit: cover; border-radius: 6px; background: #000; flex-shrink: 0; }
.place-thumb--empty { display: inline-block; }
.place-name { flex: 1; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-btns { display: flex; gap: 4px; flex-shrink: 0; }
.place-move {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  border: 1px solid var(--line); background: #fff; color: var(--tx);
  font-size: 13px; cursor: pointer;
}
.place-move:disabled { opacity: 0.3; cursor: default; }


/* ============ 2026-07-23 リスタイル(スマホ最優先・Apple風) ============
   方針: 余白と階層で整理し、枠線を減らして影で面を作る。
   説明文は「いま必要なものだけ」: 済んだフェーズの説明はCSSで畳む */

/* --- 済んだフェーズの説明は出さない --- */
/* 素材が入ったら「固定カメラがおすすめ」「待ち時間の心得」は役目を終えている */
body.mz-has-clips #dropSec .sec-lead,
body.mz-has-clips #dropSec .mz-stay-hint { display: none; }
/* 書き出しフェーズでは素材追加の点線枠も畳む(戻れば出る) */
body[data-mzj-phase="export"] .clip-slot.empty { display: none; }

/* --- 面と余白 --- */
.panel {
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 18px 16px 16px;
}
.panel + .panel, .setup-tabs, .pro-pane > .panel { margin-top: 14px; }

/* 見出しは小さく静かに(内容が主役) */
.panel h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tx2);
  margin-bottom: 12px;
}
/* opacity は付けない。--tx2(#616366 相当 6.03:1)が 0.8 で #818385=3.84:1 まで
   落ち、4.5:1 を割る。ここに入るのは装飾ではなく「(3本まで)」等の制約説明。
   見出しより静かに、は font-weight:500 が担う(2026-07-26) */
.panel h2 .hint { font-weight: 500; }

/* --- ボタン: 主役は1画面に1つ、丸く大きく --- */
.btn.primary.big {
  min-height: 52px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(30, 79, 214, 0.28);
}
.btn.primary { border-radius: 999px; }
.btn { border-radius: 10px; }

/* おまかせ/こだわりタブを丸ピルに */
.tabs { border-radius: 999px; padding: 3px; background: var(--panel2); }
.tabs .tab { border-radius: 999px; }

/* ベータ注意は控えめな一行に */
.beta-disclaimer {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--tx2);
  /* ★ 12px(2026-08-07 UI/UXレビュー🟡)。11px だと、すぐ下に並ぶ免責(12px)より
     **重要な情報のほうが小さい**という逆転が起きていた。この帯は
     「動画は送信されない」という不安払拭で、3点のうちいちばん先に読ませたい */
  font-size: 12px;
  padding: 6px 16px;
}
.beta-disclaimer strong { font-weight: 600; }

/* ステータス・ヒントの文字を一段静かに */
.status { font-size: 12px; }
.hint { font-size: 11px; }

/* モード選択カードを大きな入口に */
.mode-card {
  border: none;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 22px 18px;
}
.mode-card:active { transform: scale(0.98); }
.mode-card-name { font-size: 16.5px; font-weight: 800; }
.mode-card-desc { font-size: 12px; color: var(--tx2); }

/* ★ 縦積みのカードを「アイコン左・文字右」へ組み替える(2026-08-01 実測)。
   実測 375px でカード1枚が 179px あり、1枚目の上端が 247px。
   3枚目は下タブの裏に落ち、**選択肢が3つあること自体が初見で分からなかった**。
   アイコンを見出しの上に積むのをやめるだけで 179px → 約110px になり、
   スクロールせずに3枚とも見える＝「何が選べるのか」が最初の一目で伝わる。
   ここに置くのは上の `.mode-card { padding: 22px 18px }` より後に来る必要が
   あるため(メディアクエリは詳細度を足さないので、先に書くと負ける) */
@media (max-width: 560px) {
  .mode-card {
    display: grid; grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px; row-gap: 3px; align-items: center;
    padding: 15px 16px;
  }
  .mode-card-icon {
    /* 再編でカードが 名前/日本語補足/説明 の3行になった(種類カードのみ)。
       2行のままだと補足行がアイコンの下(1列目)へ自動配置されて潰れる */
    grid-row: 1 / span 3; grid-column: 1;
    width: 44px; height: 44px; margin-bottom: 0;
    border-radius: 12px; align-self: center;
  }
  .mode-card-icon svg { width: 24px; height: 24px; }
  .mode-card-name { grid-column: 2; align-self: end; }
  .mode-card-sub { grid-column: 2; }
  .mode-card-desc { grid-column: 2; align-self: start; line-height: 1.5; }
  /* 鍵の札も文字の側(2列目)へ。指定を忘れると自動配置でアイコンの下＝
     1列目に落ち、44pxの枠に押し込まれて潰れる(2026-08-02 実測) */
  /* justify-self を書かないと、グリッドの既定(stretch)で札が行いっぱいに
     伸びて「押せるボタン」に見える(2026-08-02 実測)。札は文字ぶんだけ */
  .mode-card-lock { grid-column: 2; align-self: start; justify-self: start; margin-top: 4px; }
}

/* スマホ: 端まで気持ちよく使う */
@media (max-width: 860px) {
  .wrap { padding: 10px 12px 90px; }
  .panel { padding: 16px 14px; }
  footer { font-size: 10.5px; }
}

/* ============ ステップ表示: ウィザード折衷案(2026-07-23) ============
   1画面で開くのは「いま決めるステップ」だけ。すんだ所は1行に畳み(タップで開閉)、
   先の所はロックのまま見せる。画面遷移はせず、全体の地図は縦に残す */
.side .panel > h2 { position: relative; }
.side .panel.step-collapsed > *:not(h2) { display: none !important; }
.side .panel.step-collapsed > h2 { margin-bottom: 0; }
.side .panel.step-collapsed > h2 .hint { display: none; }   /* 畳み中の説明はチップに譲る */
.side .panel.step-done > h2 { padding-right: 96px; }
.side .panel.step-done > h2 { cursor: pointer; }
.side .panel.step-done > h2:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; border-radius: 6px; }
/* まだ順番の来ていない工程は**出さない**(2026-07-25 優さん指示)。
   以前は opacity .55 で薄く並べていたが、押せないものが画面を占めるだけだった。
   道のりは上のジャーニーバー(1-2-3-4-5)が示すので、ここで重ねる必要がない */
.side .panel.step-locked { display: none; }
.mz-step-chip {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: var(--ok); background: rgba(30, 122, 67, 0.08);
  border-radius: 999px; padding: 4px 9px; white-space: nowrap;
}
.mz-step-chip .fa-chevron-down, .mz-step-chip .fa-chevron-up { font-size: 9px; opacity: 0.7; }


/* ============ 2026-07-23 レビュー反映 ============ */
/* おまかせ/こだわりの分岐はモード選択直後(素材の前)に置く(B-1) */
.setup-tabs-lead {
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--tx2);
}

/* 「3本まで・8分30秒まで」の理由(B-2)。制約は理由とセットで見せる */
.mz-limit-why {
  margin: 8px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(30, 79, 214, 0.06);
  border: 1px solid rgba(30, 79, 214, 0.14);
  font-size: 12px;
  line-height: 1.7;
  color: var(--tx);
}
.mz-limit-why i { color: var(--acc); margin-right: 2px; }


/* ---------- 確認ステップの自動傾き修正(2026-07-23) ---------- */
.tilt-box { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tilt-master { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.tilt-master .hint { font-weight: 500; }
.tilt-row {
  margin-top: 8px; padding: 8px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel2);
}
.tilt-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tilt-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tilt-val { font-size: 13px; font-variant-numeric: tabular-nums; flex-shrink: 0; margin-left: 8px; }
.tilt-ctrl { display: flex; align-items: center; gap: 6px; }
.tilt-range { flex: 1; min-width: 0; accent-color: var(--acc); min-height: 34px; }
.tilt-step {
  flex-shrink: 0; width: 40px; min-height: 34px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--tx);
  font-size: 17px; font-weight: 700; cursor: pointer;
}
.tilt-step:active { background: rgba(15, 33, 56, 0.08); }
.tilt-auto {
  flex-shrink: 0; min-height: 34px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--acc); font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.tilt-auto:active { background: rgba(15, 33, 56, 0.08); }


/* ---------- 中断のお知らせ(Phase 2 / 2026-07-23) ----------
   トーストは見逃すので、閉じるまで残す。進捗ドック(90)より下、通常UIより上 */
.mz-interrupt-note {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  /* 書き出し全画面(.export-overlay = 120)より前。ここを下回ると、
     iOSでタブが凍結して戻ってきた部員に「離れていた間は止まっていました」が
     一度も見えない ─ いちばん誤解しやすい瞬間の唯一の説明だった(2026-07-26) */
  z-index: 130;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: #fff7e8;
  color: var(--tx);
  font-size: 12.5px; line-height: 1.7;
  box-shadow: 0 8px 28px rgba(15, 33, 56, 0.18);
}
.mz-interrupt-note > i { color: var(--acc2); margin-top: 2px; }
.mz-interrupt-note b { font-weight: 700; }
.mz-interrupt-close {
  flex-shrink: 0; width: 30px; height: 30px; margin: -4px -4px 0 0;
  border: 0; border-radius: 8px; background: transparent;
  font-size: 17px; line-height: 1; color: var(--tx2); cursor: pointer;
}
.mz-interrupt-close:active { background: rgba(15, 33, 56, 0.08); }
/* 下部の固定要素の上へ積んで、主ボタンや進捗バーを覆わない(D-1 / 2026-07-25 実機修正)。
   以前は 69px 決め打ちで、2026-07-24 に増えたタブバー(3.6rem)を知らなかったため
   実測で #abPrimary を 72% 覆い、タップできるのは下端13pxだけだった。
   いまは実在する要素の高さを変数から足し上げる:
     --mz-tabbar-h  … shared/sitechrome.css がタブバー表示時に設定
     --mz-dock-h    … shared/progress.js が進捗ドック表示時に実測して設定
   どちらも無いときは 0 に落ちるので、単独表示のときの見た目は変わらない */
.mz-interrupt-note {
  bottom: calc(12px + var(--mz-tabbar-h, 0px) + env(safe-area-inset-bottom, 0px));
}
body.mz-actionbar-on .mz-interrupt-note {
  bottom: calc(var(--mz-actionbar-h) + 12px + var(--mz-tabbar-h, 0px) + env(safe-area-inset-bottom, 0px));
}
/* 進捗ドックが出ているときはその上へ。ドック表示中は親指バーを畳む(下の規則)ので、
   親指バーの高さは足さない */
body.mzp-docked .mz-interrupt-note {
  bottom: calc(var(--mz-dock-h, 64px) + 12px + 8px + var(--mz-tabbar-h, 0px) + env(safe-area-inset-bottom, 0px));
}

/* 進捗ドック表示中は親指バーを畳む(2026-07-25 実機修正)。
   .mz-actionbar の z-index:80 のコメントは以前から「進捗表示中はドックに譲る」
   と書いていたが、譲る規則が存在しなかった。結果ドック(z:90)が主ボタンを65%覆い、
   ドックは pointer-events:none なので「進捗バーに見えるものを押すと
   裏の『動画を選ぶ』が発火してファイルピッカーが開く」誤爆になっていた。
   進捗が動いている間は setBusy() で主ボタンが disabled なので、畳んで支障はない */
body.mzp-docked .mz-actionbar { display: none; }
@media (min-width: 860px) {
  .mz-interrupt-note { left: auto; right: 20px; max-width: 420px; }
}


/* 中断の帯を出している間は、素材欄の常設ヒントを控える(F-4 / 2026-07-23)。
   一時通知(黄)と常設案内(青)が同時に並ぶと、対処すべきものが埋もれる */
body.mz-interrupt-on #dropSec .mz-limit-why,
body.mz-interrupt-on #dropSec .mz-stay-hint {
  display: none;
}

/* ============ 分析完了の目立つ通知(2026-07-23) ============
   画面上部から下りてくる緑の帯。控えめな完了カードと違い、はっきり気づかせる */
.mz-analysis-done {
  position: fixed;
  left: 12px; right: 12px;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  z-index: 95;
  display: flex; align-items: stretch; gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--ok);
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 33, 56, 0.28);
  transform: translateY(-140%);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.32s ease;
}
.mz-adone-main {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 8px 6px 8px 10px; border: 0; background: transparent;
  color: inherit; text-align: left; cursor: pointer; border-radius: 11px;
}
.mz-adone-main:active { background: rgba(255, 255, 255, 0.15); }
.mz-analysis-done.mz-adone-show { transform: translateY(0); opacity: 1; }
.mz-analysis-done.mz-adone-hide { transform: translateY(-140%); opacity: 0; }
.mz-adone-icon { font-size: 22px; flex-shrink: 0; }
.mz-adone-text { flex: 1; font-size: 13px; line-height: 1.5; }
.mz-adone-text b { display: block; font-size: 14.5px; font-weight: 800; }
.mz-adone-close {
  flex-shrink: 0; width: 40px; align-self: stretch;
  border: 0; border-radius: 11px; background: rgba(255, 255, 255, 0.18);
  color: #fff; font-size: 15px; cursor: pointer;
}
.mz-adone-close:active { background: rgba(255, 255, 255, 0.35); }
@media (min-width: 860px) {
  .mz-analysis-done { left: auto; right: 20px; max-width: 400px; }
}

/* ============ 全画面プレビューの「これで書き出します」ラベル(2026-07-23) ============
   全画面時に下部から上品に。範囲・画質を添えて、この見た目で出ると伝える */
.mz-full-label {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 3;
  display: flex; align-items: center; gap: 9px;
  max-width: min(92%, 520px);
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(15, 33, 56, 0.72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; font-size: 13px; line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  animation: mzFullLabelIn 0.3s ease-out both;
  pointer-events: none;
}
.mz-full-label i { font-size: 16px; opacity: 0.9; flex-shrink: 0; }
.mz-full-label b { display: block; font-size: 14px; font-weight: 700; }
.mz-full-label span { min-width: 0; }
@keyframes mzFullLabelIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}





/* ============ フェーズ連動のプレビュー(2026-07-24 優さん指示) ============
   同期と分析: 見せる編集結果がまだ無いのでプレビューを出さない。
   自動編集設定(polish): モバイルではJSが常時フロート化する(ui.js側) */
body[data-mzj-phase="sync"] .stage { display: none; }
/* ★ 動画を選ぶ工程でもプレビューは出さない(2026-08-06 優さん実機
   「動画を選んだ後、戻ると、こだわりの編集画面にいく」)。
   「← 動画を選び直す」の着地はこの工程で、やることは**入れ替えだけ**なのに、
   大きなプレビューと再生バーが並ぶため編集画面にしか見えなかった。
   素材カードは自前のサムネイルを持っているので、絵を消しても選べる。
   同期・音の工程と同じ扱いにする(あちらも「見せる編集結果がまだ無い」が理由) */
body[data-mzj-phase="mat"] .stage { display: none; }
/* ★ 音を選ぶ画面はプレビューを**出す**(2026-08-06 優さん指示「そこでは視聴できるように」)。
   2026-07-28 の「絵は出さない」を明示的に反転したもの ─ 音だけを鳴らして
   選ばせると、いまどの場面の音を聴いているのかが分からなかった。
   ただしIN/OUT・カット割・タイムラインは別の工程の道具なので下で隠す */

/* ★ プレビューを足したぶんの縦を、選択肢と操作から借りない(2026-08-06 レビューP0/P1)。
   実測で、初期表示に出るのが4枚中2枚・試聴ボタンは y=840(画面外 812)まで落ち、
   「おすすめ」カードの中心タップが行動バーの主ボタンに当たっていた。
   ① 音の工程では絵を抑える ② 進め方タブはこの工程で出さない
   ③ 行動バーのぶんの余白を音のパネルに持たせる ─ の3つで1画面に戻す */
body[data-mzj-phase="audio"] #cv { max-height: 24vh; }
/* 進め方(おまかせ/こだわり)はここで切り替える作業ではない。しかも「おまかせ」が
   1画面に2つ並び、どちらも選択中に見えていた(レビューP1) */
body[data-mzj-phase="audio"] #setupTabs { display: none; }
/* 行動バーは半透明すりガラスなので、下に隠れたカードは「薄く見えているのに
   押せない」= 押せる要素に見える最悪の状態になる。実体ぶん余白を空ける */
body.mz-actionbar-on[data-mzj-phase="audio"] #audioSec {
  padding-bottom: calc(var(--mz-actionbar-h) + 14px + env(safe-area-inset-bottom, 0px));
}
/* おまかせは「動画1/2/3」とは種類が違う選択肢だと、見た目でも分かるようにする */
.audio-choice-auto { margin-bottom: 10px; position: relative; }
.audio-choice-auto::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -6px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
/* 試聴の文言が「試聴する」→「停止」と縮むと、隣の主ボタンが28px横へ動いていた */
#audioListenBtn { min-width: 96px; justify-content: center; }
/* 傾きの確認中はプレビューの絵だけ。再生バーとIN/OUTは別の工程の道具で、
   固定表示のプレビューに重なって見えてもいた(2026-07-28) */
/* ★ セレクタは body.mz-pin-force で。data-mzj-phase="tilt" を前提にすると、
   工程の名前を変えた日にこの3本が黙って死ぬ(2026-07-31 に一度やった)。
   mz-pin-force は renderTiltSec が付け unpinTilt が外す 1:1 の印なので、
   傾きを直している最中と完全に一致する */
body.mz-pin-force .transport,
body.mz-pin-force .trim-row,
body.mz-pin-force #cutModeBtn { display: none; }
/* 範囲(IN/OUT)・カット切替・タイムラインは**範囲が決まってから**の道具。
   素材を選んでいる段・傾きを直している段では、押しても意味が無い
   (実測 2026-08-01: 素材の画面に押せるものが16個あり、IN/OUT/リセットは
   まだ何も同期していない状態で並んでいた)。
   出すのは「長さと開始位置」の工程だけにする。
   書き出しの画面も「画質を選んで書き出す」だけに保つ(2026-07-28) */
body[data-mzj-phase="mat"] .trim-row,
body[data-mzj-phase="tilt"] .trim-row,
body[data-mzj-phase="sync"] .trim-row,
body[data-mzj-phase="audio"] .trim-row,
body[data-mzj-phase="export"] .trim-row,
body[data-mzj-phase="mat"] #cutModeBtn,
body[data-mzj-phase="tilt"] #cutModeBtn,
body[data-mzj-phase="audio"] #cutModeBtn,
body[data-mzj-phase="export"] #cutModeBtn,
body[data-mzj-phase="mat"] #timelineWrap,
body[data-mzj-phase="tilt"] #timelineWrap,
body[data-mzj-phase="audio"] #timelineWrap,
body[data-mzj-phase="export"] #timelineWrap { display: none !important; }


/* ============ 書き出しの全画面(案B / 2026-07-24) ============
   ドットは増やさず、書き出し中→保存 をこの中で切り替える(Apple Photos/iMovieの型)。
   進捗(MZP)は #eoProgress にそのまま実る */
/* ★ 完成画面だけは字送りを元のまま(2026-08-07)。
   body に line-height:1.7 を入れたところ、この画面の出口(シェア/別の動画/閉じる)が
   375x667(iPhone SE)で **672px** となり画面の外へ出た(QAが検出)。
   この全画面には「出口まで1画面に収まる」という契約があり(2026-08-02 レビュー)、
   巻けることに気づけないと「閉じるが無い」と読まれる。
   読ませたい説明文にだけ、個別に行間を与える */
.export-overlay { line-height: normal; }
.export-overlay .eo-note, .export-overlay #eoDoneText { line-height: 1.6; }

.export-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: var(--bg);
  /* align-items:center は使わない。overflow-y:auto と併せると、中身が画面より
     高いとき上へはみ出した分にスクロールで到達できなくなる(記録を開くと
     「できあがりました」と一行説明が消える。2026-07-26)。
     margin-block:auto なら収まるときは中央、溢れたら上端から読める */
  display: flex; justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px
           calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.eo-inner {
  width: min(480px, 100%); margin-block: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.eo-title {
  font-size: 18px; font-weight: 800; color: var(--navy);
  display: flex; align-items: center; gap: 8px; justify-content: center;
}
.eo-title i { color: var(--acc); }
.eo-oneline { margin-top: 6px; font-weight: 600; color: var(--tx); }

.eo-stats { margin: 14px 0 0; text-align: left; }
.eo-stats > summary { cursor: pointer; font-size: 13px; opacity: .65; padding: 6px 0; list-style: none; }
.eo-stats > summary::-webkit-details-marker { display: none; }
.eo-stats > summary::before { content: "\25B8"; display: inline-block; width: 1em;
  transition: transform .15s ease; }
.eo-stats[open] > summary::before { transform: rotate(90deg); }
.eo-stats pre { margin: 6px 0 10px; padding: 12px 14px; border-radius: 10px;
  background: rgba(127, 127, 127, .12); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; word-break: break-word; overflow-x: auto; }

/* ★ 書き出し中のライブプレビュー(2026-08-02)。exporter が合成中のコマを
   約970msに1回映す。縦型(9:16)でも 375×667 で進捗と出口が同じ画面に残るよう
   高さは 34dvh で頭打ち(480×270 の16:9なら幅いっぱい)。attrの実寸は
   exporter.livePreview が長辺480で入れるので、ここは収まりだけを決める */
.eo-live {
  display: block; margin: 0 auto;
  max-width: 100%; max-height: 34vh; max-height: 34dvh;
  border-radius: 12px; background: #000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.eo-note { font-size: 12.5px; color: var(--tx2); line-height: 1.7; text-align: center; }
.eo-note i { color: var(--acc2); margin-right: 3px; }
#eoRun, #eoDone { display: flex; flex-direction: column; gap: 14px; }
#eoCancel { align-self: center; min-width: 120px; }
.eo-done-text { font-size: 14px; text-align: center; line-height: 1.7; }
.eo-actions { display: flex; flex-direction: column; gap: 10px; }
.eo-actions .btn { width: 100%; }
/* ★ 未保存のあいだ、「動画を保存」を画面の中央付近へ置く(2026-08-02 優さん実機指摘
   「保存ボタンが真ん中に来るように調整」)。実測375pxでは、完成画面の主ボタンが
   上寄りに出て、親指の自然な位置には「別のシーンも作れます」の候補が来ていた。
   ─ やり方: 完成画面の塊(題・サイズ・保存・別のシーン・出口)はそのまま詰めておき、
     **塊ごと下へ送る**。送る量は「主ボタンの中心が画面の中央に来る」ぶん＝
     50dvh から、塊の先頭から主ボタン中心までの距離(実測134px)を引いた値。
   ─ 実測（レビューで測り直し 2026-08-02）
       375×667: 主ボタン中心 325px（画面中央 334px の 9px 上）・
                「閉じる」の下端 662px＝**出口まで1画面に収まる**
       375×812: 主ボタン中心 398px（画面中央 406px の 8px 上）・出口も同じ画面
       横向き812×375: 主ボタン中心 179px（中央 188px）。塊が画面より高いので
                出口は下へ続く(横向きで巻くのは自然)
   ─ 前の版は #eoDone を 92dvh に引き伸ばして中身を上下中央に置いていた。
     主ボタンは中央に来たが、**引き伸ばした箱の中で中身が中央に寄る**ため
     画面の上下に空白の穴ができ(375×812で上290px・下258px)、出口(シェア・
     ツール一覧・閉じる)は1スクロール下へ落ちていた。「92dvhで端を覗かせる」は
     覗く先が空白だったので効いていない ─ 何も見えないので巻けると気づけない。
   ─ margin-block の**下は auto のまま**にする。0 にすると .eo-inner が
     親(display:flex)の既定 stretch で画面いっぱいに伸ばされ、中の縦フレックスが
     縮んで**出口が別のシーンに重なる**(横向き812×375で実測)。
   ─ dvh は iOS Safari 16+(採用基準)で使える。古い実装向けに vh も並べる。
   ─ 保存が済んだらこの塊ごと外れ、通常の詰め方に戻る
     (用の済んだボタンを中央に置き続けない) */
.export-overlay.eo-await-save .eo-inner {
  margin-block: max(0px, calc(50vh - 134px)) auto;
  margin-block: max(0px, calc(50dvh - 134px)) auto;
}
/* 完了時の登場アニメ(2026-07-24 案B B: 達成感を出す)。
   [hidden]→表示に切り替わった瞬間に一度だけ走る */
#eoDone:not([hidden]) { animation: eoRise .34s cubic-bezier(.2,.7,.3,1) both; }
@keyframes eoRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eo-title i.eo-check { color: #2fa36b; animation: eoPop .42s cubic-bezier(.2,.8,.3,1.5) both; }
/* 失敗表示(2026-07-25 実機レビュー)。危険色にして、待機の案内文だけを消す。
   #eoProgress(失敗理由のカード)は #eoRun の中にあるので隠してはいけない */
.eo-title i.eo-fail { color: var(--err); }
.export-overlay.eo-failed .eo-note { display: none; }
@keyframes eoPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }
/* ダウンロードは「動画を保存」に対する控えめな二次導線(案B A) */
.eo-dl { font-size: 13px; opacity: .85; }
@media (prefers-reduced-motion: reduce) {
  #eoDone:not([hidden]), .eo-title i.eo-check { animation: none; }
}
.eo-close { align-self: center; min-width: 120px; }
/* オーバーレイ表示中はフロートやバー類を引っ込める(全部この画面が主役) */
body.mz-export-open .mzj,
body.mz-export-open .mz-actionbar,
body.mz-export-open .canvas-holder { display: none !important; }


/* ---------- 素材が1本も無いうちは、映像まわりを丸ごと出さない ----------
   2026-07-28 優さん指示「1画面1操作」。実測で、最初の工程(動画を選ぶ)の画面に
   押せるものが40個あり、うち6個が再生/スクラブ/IN/OUT/リセット ─ まだ
   1本も素材が無いので、どれを押しても何も起きない。空の黒枠(約400px)も
   「動画を選ぶ」を画面の外へ押し出していた。
   素材が入った瞬間に mz-has-clips が付いて元どおり出る(ui.js:460)。 */
body:not(.mz-has-clips) .stage { display: none; }

/* 素材が無いうちは「おまかせで仕上げます／分析を開始」を出さない。
   まだ1本も選んでいない画面に主ボタンが2つ見えていた(2026-07-28) */
body:not(.mz-has-clips) #easyPane { display: none; }

/* ---------- 工程が進んだら、その工程のものだけを残す 2026-07-28 ----------
   実測(375x700・3本)で、設定の画面に押せるものが29個あり、そこに
   「動画を書き出す」が2つ出ていた ─ #easyStartBtn(二役で書き出しに化ける)と
   #exportBtn。分析が済んだあとは #exportSec が主役なので、おまかせの枠は畳む。
   「最初からやり直す」を mat の画面だけに絞るのは**やってはいけない**。
   data-mzj-phase は「計算された現在地」なので、素材が揃うと mat へは戻らず、
   脱出口が永久に押せなくなる(2026-07-28 実測で確認して撤回)。
   破壊操作である点は、置き場所ではなく確認ダイアログで守ること。 */
/* ↑の出し分けは applySteps(.step-off)へ移した(2026-07-28)。
   data-mzj-phase を別途見ると二重に効いて、同期の画面が空になる */


/* ---------- 1画面1操作: いまの工程だけを出す 2026-07-28 ----------
   applySteps が現在地以外のパネルへ .step-off を付ける。
   済んだ工程を1行に畳んで並べる方式(step-collapsed)は捨てた ─ 実測で
   設定の画面が 29個 / 2039px あり、畳み方の調整では届かなかった。 */
.side .panel.step-off,
#easyPane.step-off { display: none !important; }

/* おまかせ/こだわりの出し分け。工程の出し分け(.step-off)とは別の軸なので、
   両方が「出す」と言ったときだけ出る(ラッパで隠すと工程の画面ごと消えた) */
body.tab-easy #syncSec,
body.tab-easy #layoutSec { display: none !important; }
/* ★ #finishSec(色とフィルター)は おまかせ でも出す(2026-08-01)。
   工程「仕上げ設定」を畳んで書き出しの画面へ入れたのに、この1行が
   おまかせのまま使う人から**色を永久に隠していた** ─
   こだわりタブへ切り替えないと触れない。色を変えたいのは、
   むしろ細かい設定を触らない人のほうで、順序が逆だった。
   #syncSec(手動同期) と #layoutSec(レイアウト調整)は こだわり のまま */
body.tab-pro #easyPane { display: none !important; }

/* 選択画面 2段目の「種類を選び直す」(2026-08-01)。
   見出しの上に置く小さな戻り道。44ptは割らない */
/* ★ 左端に置く(2026-08-02 優さん指示⑨)。.mode-inner が text-align:center なので、
   inline のままだと戻るが中央に浮いて見つけられなかった */
.mode-step-back { display: flex; align-items: center; min-height: 44px;
  margin-right: auto; text-align: left;
  padding: 0 4px; margin-bottom: 2px; border: none; background: none;
  color: var(--acc); font: inherit; font-size: 14px; cursor: pointer; }
.mode-step-back:active { opacity: .6; }
#modeStepKind[hidden], #modeStepFlow[hidden] { display: none; }

/* 傾きを飛ばす道(2026-08-01)。主ボタン(この動画はOK)より明らかに弱く。
   ただしタップ標的は44pt を割らない ─ 弱く見せることと押しにくくすることは違う */
.tilt-skip { display: block; width: 100%; min-height: 44px; margin-top: 12px;
  border: none; background: none; color: var(--tx2); font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tilt-skip:active { color: var(--tx); }
.tilt-skip-note { margin: 2px 0 0; text-align: center; font-size: 11px; }

/* 傾きの微調整の格納(2026-07-28) */
.tilt-fine > summary {
  cursor: pointer; font-size: 12.5px; color: var(--tx2);
  padding: 8px 2px; min-height: 44px; display: flex; align-items: center;
  -webkit-user-select: none; user-select: none;
}
.tilt-fine[open] > summary { color: var(--tx); }

/* ---------- 傾きの確認(2026-07-28) ----------
   プレビューは position:fixed で流れの高さを持たないので、
   その分の場所を空けないと見出しと説明が永久に隠れる
   (実測375x700: h2が100%・説明が57%被覆、しかも scrollHeight===innerHeight で
    スクロールもできなかった) */
/* 空ける量は固定値にしない。30vh を仮定すると端末で141px余ったり足りなかったりする
   (実測)。renderTiltSec が実際のプレビュー下端から測って --mz-tilt-pad に入れる */
body.mz-pin-force .side { padding-top: var(--mz-tilt-pad, 0px); }
.tilt-stage { margin-top: 10px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel2); }
.tilt-top { display: flex; align-items: center; gap: 10px; }
.tilt-thumb { width: 52px; height: 31px; object-fit: cover; border-radius: 5px;
  background: #0b0e13; flex: 0 0 auto; }
.tilt-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tilt-count { font-size: 13px; font-weight: 700; color: var(--tx2); }
.tilt-who .hint { font-size: 11px; }
#tiltVal2 { margin-left: auto; font-size: 24px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
.tilt-crop { margin: 6px 0 0; color: #a8601a; }
/* 連打する前提なので44pt以上を確保(実測40x34だった) */
body.mz-pin-force .tilt-step { width: 52px; min-height: 48px; font-size: 20px; }
#tiltOkBtn, #tiltPrevBtn { min-height: 48px; }

/* 完成画面の顔の注意(2026-07-29) */
/* .eo-faces は撤去(2026-08-01 優さん指示。#eoFaces ごと消した) */

/* 書き出し前の注意書き(2026-07-29) */
/* ロゴの説明。プレビューの真上に1行だけ。主張しすぎない小さな文字で、
   プレビューを押し下げないよう余白を詰める(2026-08-01) */
.wm-note { color: #4a5568; margin: 0 0 6px; font-size: 12px; line-height: 1.4;
  text-align: center; width: 100%; max-width: 720px; }
.wm-note[hidden] { display: none; }
.wm-note i { opacity: .6; margin-right: 4px; }
.save-note { color: #1f6f4a; }
.wm-note b, .save-note b { font-weight: 700; }

/* 端末に残った書き出しデータの片付け(2026-08-06 優さん実機 14.88GB)。
   警告色にはしない ─ 壊れているわけではなく「片付けられます」という案内。
   溜まっているときしか出ないので、出たときは必ず押せる形にする */
.storage-note { margin: 10px 0 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(15, 23, 42, 0.04); border: 1px solid rgba(15, 23, 42, 0.12);
  display: flex; align-items: center; gap: 12px; }
.storage-note-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.storage-note-head { font-size: 14px; line-height: 1.45; color: #0f172a; }
.storage-note-sub { font-size: 12.5px; line-height: 1.5; color: #57607a; }
.storage-note .btn { flex: none; min-height: 44px; }
@media (max-width: 460px) {
  .storage-note { flex-direction: column; align-items: stretch; }
  .storage-note .btn { width: 100%; }
}

/* Safari容量診断。管理者判定を通ったときだけHTMLを組み立てる。 */
.storage-diag { margin: 10px 0 14px; padding: 14px; border-radius: 16px;
  background: #f7f9ff; border: 1px solid rgba(37, 84, 204, .18); color: #17213b; }
.storage-diag[hidden] { display: none; }
/* ?tool=reel|switcher|wipe は種類が確定済み。HTMLの解析途中で3枚カードを
   描画させず、toolscope/ui.js が2段目を開くまで隠す。 */
html[data-mz-tool-scope] #modeStepKind { display: none !important; }
/* 管理者が容量診断を始めたスマホでは、host を body直下へ退避して固定する。
   :has() と #workspace 配下の fixed に頼ると、全画面分析やSafariの再描画で
   入力欄だけ触れない状態を作り得るため。一般利用者には host 自体が hidden。 */
body.mz-storage-diag-active #storageDiagDock > #storageDiag {
  position: fixed;
  top: calc(var(--mz-journey-h, 72px) + env(safe-area-inset-top, 0px) + 8px);
  left: 10px;
  right: 10px;
  z-index: 151;
  max-height: min(68dvh, 560px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 8px 20px rgba(15, 33, 86, .14);
}
/* 記録中でも素材操作を優先する。iPhoneでは普段は小さな帯だけを固定し、
   管理者が「開く」を押した時だけ従来の詳細カードを出す。 */
body.mz-storage-diag-active #storageDiagDock > #storageDiag.sd-compact {
  padding: 8px 10px;
  max-height: none;
  overflow: visible;
}
.sd-compact-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sd-compact-bar > div { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.sd-compact-bar b { flex: none; font-size: 13px; color: #17213b; }
.sd-compact-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #59647d; font-size: 12px; }
.sd-compact-bar .btn { flex: none; min-height: 38px; padding: 6px 12px; }
.mobile-length-pick { border-color: rgba(37, 84, 204, .35); }
.mobile-length-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mobile-length-choice { min-height: 126px; padding: 14px 10px; border: 1px solid #b8c8f2; border-radius: 14px;
  background: #f7f9ff; color: var(--navy); text-align: left; display: flex; flex-direction: column; gap: 5px; }
.mobile-length-choice b { font-size: 24px; line-height: 1.05; }
.mobile-length-choice span { color: var(--tx2); font-size: 12px; line-height: 1.35; }
.mobile-length-choice em { margin-top: auto; color: var(--acc-deep); font-style: normal; font-weight: 700; font-size: 13px; }
.mobile-length-choice:active { transform: scale(.98); background: #edf2ff; }
.sd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sd-head > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.sd-head b { font-size: 14px; line-height: 1.4; }
.sd-head span, .sd-result span { color: #59647d; font-size: 12px; line-height: 1.5; }
.sd-live { flex: none; padding: 3px 8px; border-radius: 999px; background: #e4ecff;
  color: #2754cc !important; font-size: 11px !important; font-weight: 700; }
.sd-head-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.sd-fold { min-height: 34px; padding: 4px 8px; font-size: 12px; }
.sd-primary { width: 100%; min-height: 44px; margin-top: 12px; }
.sd-result { display: flex; flex-direction: column; gap: 3px; margin: 12px 0;
  padding: 10px 11px; border-radius: 12px; background: #fff; border: 1px solid rgba(37,84,204,.12); }
.sd-result b { font-size: 13px; line-height: 1.5; }
.sd-recorded { color: #1f6f4a !important; font-weight: 700; }
.sd-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: #35405b; }
.sd-measure { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 7px; }
.sd-measure input { width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid #bcc7df;
  border-radius: 10px; background: #fff; color: #17213b; font: inherit; }
.sd-measure > span { font-size: 13px; color: #59647d; }
.sd-measure .btn, .sd-actions .btn { min-height: 44px; }
.sd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.sd-actions .btn:last-child { grid-column: 1 / -1; }
.sd-plan { margin: 12px 0; padding: 10px 11px; border-radius: 12px;
  background: rgba(37,84,204,.06); border: 1px solid rgba(37,84,204,.12); }
.sd-plan b { display: block; font-size: 12px; color: #283a67; }
.sd-plan span { display: block; margin-top: 3px; color: #59647d; font-size: 12px; line-height: 1.5; }
.sd-plan-actions { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 9px; }
.sd-plan-actions .btn { min-height: 44px; text-align: left; }
.sd-plan-actions .btn[disabled] { opacity: .52; }
.sd-release-wrap { display: grid; gap: 3px; }
.sd-release-hint { margin: 0 !important; padding-left: 2px; color: #7a849b !important; font-size: 11px !important; }
.sd-notice { margin: 9px 0 0; color: #59647d; font-size: 11.5px; line-height: 1.55; }
.sd-report { width: 100%; min-height: 180px; margin-top: 10px; padding: 9px; border-radius: 10px;
  border: 1px solid #bcc7df; background: #fff; font: 11px/1.55 ui-monospace, monospace; }
@media (max-width: 460px) {
  .sd-measure { grid-template-columns: minmax(0,1fr) auto; }
  .sd-measure .btn { grid-column: 1 / -1; width: 100%; }
  .sd-actions { grid-template-columns: 1fr; }
  .sd-actions .btn:last-child { grid-column: auto; }
  .sd-compact-bar > div { display: block; }
  .sd-compact-bar b, .sd-compact-bar span { display: block; }
  .sd-compact-bar span { max-width: 210px; }
}

/* 前回のつづきの案内(2026-07-29) */
.resume-note { margin: 10px 0 12px; padding: 12px 14px; border-radius: 12px;
  background: rgba(31, 111, 74, 0.07); border: 1px solid rgba(31, 111, 74, 0.22); }
.resume-note p { margin: 0 0 6px; font-size: 13px; line-height: 1.6; }
.resume-note .rn-head { color: #1f6f4a; font-size: 14px; }
.rn-list { margin: 4px 0 8px; padding-left: 1.4em; font-size: 13px; }
.rn-list li { margin: 2px 0; word-break: break-all; }
.save-note > summary { cursor: pointer; padding: 10px 2px; min-height: 44px;
  display: flex; align-items: center; gap: 6px; color: #1f6f4a; font-size: 13px; }
.save-note p, .save-note ol { font-size: 13px; line-height: 1.65; margin: 4px 0 8px; }
.save-note ol { padding-left: 1.3em; }
.save-note li { margin: 6px 0; }

/* 止まった位置の内訳(2026-07-29) */
.mz-stall-detail { display: inline-block; margin-top: 4px; font-size: 11.5px;
  opacity: .85; font-variant-numeric: tabular-nums; }

/* 原因さがし用の切り分けトグル(2026-07-30) */
.diag-box { margin-top: 10px; }
.diag-box > summary { cursor: pointer; padding: 10px 2px; min-height: 44px;
  display: flex; align-items: center; gap: 6px; color: var(--tx2); font-size: 13px; }
.diag-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 13px; }
.diag-toggle input { width: 20px; height: 20px; }
.diag-box .hint { line-height: 1.6; }
/* 診断モード中はひと目で分かるように帯を出す */
body.mz-diag-noskip #exportSec::before {
  content: "原因さがしモード（ゆっくり書き出します）";
  display: block; margin: 0 0 10px; padding: 7px 10px; border-radius: 8px;
  background: #fff4d6; color: #7a5200; font-size: 12.5px; font-weight: 700;
}

/* ============ 長さと始まりを決める(2026-07-31 優さん指示) ============
   1画面に「長さ」と「始まり」の2つの問いだけを置く。
   選択肢は消さずに鍵つきで見せ、何をすれば使えるかをその場で言う。 */
.len-head { display: flex; align-items: center; gap: 7px;
  margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: var(--tx); }
.len-head:first-of-type { margin-top: 10px; }
.len-head i { color: var(--acc); font-size: 12px; }

.len-presets { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .len-presets { grid-template-columns: repeat(3, 1fr); } }
/* flex(1行)ではなく grid にする。flex だと解除の案内(.len-unlock)が同じ行へ
   割り込み、「8分30秒」が1文字ずつ折り返して3行になった(375px 実測) */
.len-card { display: grid; width: 100%;
  grid-template-columns: auto auto 1fr; align-items: baseline;
  column-gap: 10px; row-gap: 5px;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; text-align: left; font-family: inherit;
  min-height: 60px; }
@media (min-width: 620px) { .len-card { grid-template-columns: 1fr; row-gap: 2px; } }
.len-card.on { border-color: var(--sel-ring); background: var(--sel-bg);
  box-shadow: inset 0 0 0 1px var(--sel-ring), 0 1px 3px rgba(30, 79, 214, 0.14); }
.len-card.on .len-name { color: var(--acc-deep); }
.len-name { font-size: 14px; font-weight: 800; color: var(--tx); white-space: nowrap; }
.len-dur { font-size: 13px; font-weight: 700; color: var(--acc-deep);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.len-why { font-size: 11.5px; color: var(--tx2); text-align: right; min-width: 0; }
@media (min-width: 620px) { .len-why { text-align: left; } }
/* 使えない選択肢: 消さずに鍵つきで残す(存在に気づけないと登録動機にならない) */
.len-card.locked { background: var(--panel2); border-style: dashed; cursor: default; }
.len-card.locked .len-name, .len-card.locked .len-dur { color: var(--tx2); }
.len-unlock { grid-column: 1 / -1; font-size: 11px;
  font-weight: 700; color: var(--acc-deep); }
.len-unlock i { margin-right: 4px; }

.len-starts { display: flex; flex-direction: column; gap: 6px; }
/* 枠は div、「選ぶ」と「聴く」は**兄弟のボタン**。
   以前は枠自体が <button> で、その中へ聴くボタンを appendChild していた ─
   HTMLとして不正で、読み上げでも入れ子の対話要素は正しく扱われない */
.len-start { display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 0 8px 0 0; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; min-height: 56px; }
.len-start.on { border-color: var(--sel-ring); background: var(--sel-bg);
  box-shadow: inset 0 0 0 1px var(--sel-ring), 0 1px 3px rgba(30, 79, 214, 0.14); }
.len-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 9px 4px 9px 12px; min-height: 54px;
  background: none; border: 0; border-radius: 11px;
  cursor: pointer; text-align: left; font-family: inherit; color: inherit; }
.len-ico { flex-shrink: 0; width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center; background: var(--panel2); color: var(--tx2); font-size: 14px; }
.len-start.on .len-ico { background: var(--acc); color: #fff; }
.len-body { flex: 1; min-width: 0; }
/* ラベルと理由は必ず行を分ける。inline のままだと
   「大盛り上がり全員で一番大きく鳴っているところ」と地続きに読めてしまう */
.len-label { display: block; font-size: 13.5px; font-weight: 800; color: var(--tx); line-height: 1.35; }
.len-start.on .len-label { color: var(--acc-deep); }
.len-reason { display: block; font-size: 11.5px; color: var(--tx2); line-height: 1.4; }
.len-at { flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--tx2);
  font-variant-numeric: tabular-nums; }
.len-listen { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--acc);
  font-size: 14px; cursor: pointer; display: grid; place-items: center; }
.len-listen.playing { background: var(--acc); color: #fff; border-color: var(--acc); }

.len-summary { margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: #f0f5ff; color: var(--acc-deep); font-size: 12.5px; font-weight: 700;
  line-height: 1.6; }
.len-summary:empty { display: none; }
/* 選ぶ余地が無いとき(演奏まるごとを覆う長さ)は問い自体を出さない */
#lenStartBox[hidden] { display: none; }

/* 「自分で選ぶ」の位置スライダー(2026-07-31 優さん指示)。
   おすすめの5つで足りない人の逃げ道。拍にスナップするので、
   どこで止めても音楽の頭から始まる */
.len-manual { margin-top: 8px; padding: 12px; border-radius: 12px;
  background: var(--panel2); border: 1px solid var(--line); }
.len-manual-range { width: 100%; margin: 0 0 8px; accent-color: var(--acc);
  height: 44px; min-height: 44px; }
.len-manual-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.len-manual-at { font-size: 15px; font-weight: 800; color: var(--acc-deep);
  font-variant-numeric: tabular-nums; }
.len-manual-row .btn { margin-left: auto; }

/* 鍵つきの長さを押したときの案内(2026-07-31 UI/UXレビュー P0)。
   「無料登録で使えます」と書いておきながら押しても無反応で、
   登録への道がこの画面に1つも無い、という行き止まりを塞ぐ */
.len-unlock-note { margin-top: 8px; padding: 12px 14px; border-radius: 12px;
  background: #fff8e6; border: 1px solid #f0d9a0; }
.lun-title { font-size: 13px; font-weight: 800; color: #7a5200; margin-bottom: 4px; }
.lun-title i { margin-right: 6px; }
.lun-body { font-size: 12px; color: var(--tx2); line-height: 1.7; }
/* <a>(登録へ)と <button>(リンクをコピー)の両方が同じ見た目になるようにする ─
   button は既定の枠と font-family を持つので明示的に消す */
.lun-btn { display: inline-flex; align-items: center; justify-content: center;
  margin-top: 10px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--acc); color: #fff; font-weight: 800; font-size: 13px;
  text-decoration: none; border: 0; font-family: inherit; cursor: pointer; }
.lun-btn i { margin-right: 7px; }


/* ============ 素材カードのかたむきバッジ ============
   傾きは単独の工程に戻したが(2026-07-31)、カードの✓/⚠は残す ─
   どの動画が済んでいるかが一目で分かり、押すとその動画のページへ飛べる */
.tilt-badge { display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px; padding: 8px 14px; min-height: 44px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font-family: inherit; }
.tilt-badge.todo { background: #fff4d6; border-color: #f0d9a0; color: #7a5200; }
.tilt-badge.done { color: var(--ok); }
/* #eoPreEta は撤去(2026-08-01 優さん指示「文字が多い」。要素ごと消した) */
/* かたむきバッジ: 状態は名詞、押せることは › で示す(iOS Safari は title を読まない) */
.tilt-badge-go { margin-left: auto; font-size: 16px; opacity: .5; }
.tilt-badge { width: 100%; justify-content: flex-start; text-align: left; }

/* ============ おまかせ専用の1画面(2026-08-01 優さん指示) ============
   こだわりの設定は一切見せない。出すのは
   「大きなプレビュー / 進み具合 / いま何をしているか / あと何分」の4つだけ。
   段が1つ済むたびにチェックが点く ─ これが「できていってる！」の手触り */
.auto-stage {
  position: fixed; inset: 0; z-index: 130;   /* 書き出しの全画面(120)より上 */
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  /* ★ align-items:center のまま溢れると、はみ出した分は**上へ消えて
     スクロールでは戻せない**(scrollTop が負にならないため)。
     実測: iPhone横向き 812x375 で上端 -62px、最大スクロールしても -141px と
     さらに上へ離れ、「おまかせ」バッジも見出しもプレビュー上部も
     二度と見えなかった(320x460 でも -105px)。
     flex-start + margin:auto なら、中央寄せを保ったまま両端に必ず届く */
  display: flex; align-items: flex-start; justify-content: flex-start;
  /* ★ 左右にもノッチぶんを足す(2026-08-01)。iPhone を横に倒すと、
     どちらか一方の端 44px がノッチとカメラに食われる。上下だけ見ていたため、
     横向きでは「おまかせ」バッジや「やめる」がその下へ潜っていた */
  padding: calc(16px + env(safe-area-inset-top, 0px))
           calc(16px + env(safe-area-inset-right, 0px))
           calc(16px + env(safe-area-inset-bottom, 0px))
           calc(16px + env(safe-area-inset-left, 0px));
  overflow-y: auto;
}
.auto-stage[hidden] { display: none; }
/* 全画面の裏で本体がスクロールしないように固定する。
   ★ 実測でページ高967px(画面812)だったが、内訳を見ると全画面自体は
     562pxで収まっており、溢れていたのは**背後の作業画面**だった。
     全画面を削るのではなく、背後を止めるのが正しい対処 */
/* ★ body だけでは効かない。実測で 155px スクロールできた ─
   ルート要素(html)にも当てて初めて止まる。
   高さも 100% に固定しないと、中身の高い作業画面が土台を押し広げる */
html:has(body.mz-auto-stage), body.mz-auto-stage {
  overflow: hidden !important; height: 100%;
}
.as-inner { width: 100%; max-width: 520px; margin: auto;
  display: flex; flex-direction: column; gap: 10px; }

/* 読み上げ専用(目には見えない)。display:none だと読み上げにも届かない */
.mz-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.as-what { margin: -4px 0 0; font-size: 12px; color: var(--tx2); }
.as-wait { margin: 0; text-align: center; font-size: 12px; color: var(--tx2); }

.as-title { display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: 17px; font-weight: 800; color: var(--tx); }
.as-badge { flex: none; padding: 2px 9px; border-radius: var(--r-pill);
  background: rgba(30, 79, 214, .12); color: var(--acc); font-size: 11px; font-weight: 800; }

/* プレビュー。ここが主役なので大きく取る */
/* ★ 枠を絵に吸い付かせる(2026-08-01 レビュー14件)。width:100% 固定だったため、
   9:16 の縦型では実測 343x222 の枠に絵が 125x222 しか無く、
   主役のプレビューの**64%が黒帯**だった。
   width:auto + align-self:center で、どの比率でも黒帯が出ない */
.as-preview { width: auto; max-width: 100%; align-self: center;
  display: flex; justify-content: center;
  background: #000; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(15, 33, 56, .16); }
/* ★ 画面に収める(2026-08-01 レビューP2)。実測でページ高967px対画面812pxと
   155px溢れ、初期表示で中止ボタンが見えなかった。
   プレビューは主役なので削りすぎない ─ 溢れていた分だけ詰める */
.as-preview canvas { display: block; width: auto; height: auto;
  max-width: 100%; object-fit: contain; }
/* ★ 高さの上限は **ID を含めて** 名乗る(2026-08-01 実測)。
   `#cv { max-height: 35vh }`(スマホ用・style.css:313)は詳細度 (1,0,0) で、
   `.as-preview canvas` の (0,1,1) を無条件に上回る。つまり
   「主役なので大きく取る」と書いてあったこの枠は一度も効いておらず、
   実測で max-height が 131.25px(=35vh) に潰されていた ─
   横向きでは主役のプレビューが 75x131 しかなかった。
   `.auto-stage #cv` なら (1,1,0) で勝てる */
.auto-stage #cv { max-height: min(40vh, 340px); }

/* 進み具合 */
.as-bar { height: 8px; border-radius: 999px; background: rgba(15, 33, 56, .10); overflow: hidden; }
.as-bar-fill { height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--acc), #4b7bff);
  transition: width .45s cubic-bezier(.22, .8, .3, 1); }
.as-meta { display: flex; align-items: baseline; justify-content: space-between;
  margin: 0; font-size: 13px; color: var(--tx2); }
/* ★ 大きさを入れ替える(2026-08-07 UI/UXレビュー🟡・実測)。
   「28%」が22px/800、「あと およそ6分」が13px/400 だった。5〜9分待つ人が
   知りたいのは進捗率ではなく「席を立ってよいか」で、%は残り時間に換算できない ─
   いちばん役に立たない数字が一等地を占めていた */
.as-pct { font-size: 13px; font-weight: 700; color: var(--tx2);
  font-variant-numeric: tabular-nums; }
.as-eta { font-size: 20px; font-weight: 800; color: var(--tx);
  font-variant-numeric: tabular-nums; }

/* 段のチェックリスト */
.as-steps { list-style: none; margin: 0; padding: 0; display: flex;
  flex-direction: column; gap: 2px; }
.as-step { display: flex; align-items: center; gap: 10px; padding: 6px 4px;
  font-size: 14px; color: var(--tx2); transition: color .25s ease; }
.as-step i { width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; background: rgba(15, 33, 56, .07); color: var(--tx2);
  transition: background .3s ease, color .3s ease, transform .3s ease; }
/* いま動いている段: 濃く + 脈打つ */
.as-step.now { color: var(--tx); font-weight: 700; }
.as-step.now i { background: var(--acc); color: #fff; animation: asPulse 1.3s ease-in-out infinite; }
/* 済んだ段: 緑のチェック。ここが点く瞬間が「できていってる！」 */
.as-step.done { color: var(--tx); }
.as-step.done i { background: rgba(30, 122, 67, .16); color: var(--ok);
  animation: asPop .35s cubic-bezier(.2, 1.4, .4, 1); }
/* ★ 左の段名も1行に固定する(2026-08-01 実測)。前は .as-step-sub にだけ
   nowrap を当てていたため、**左側**が折れて行が 34px → 54px に膨らんでいた。
   実測: 375px で1行、320px では6行中3行が2行に折れ、全体が 143px 溢れていた。
   行の高さが揃わないと、済んだ✓が下から順に点いていく気持ちよさが消える */
.as-step-t { flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 右は「その段で分かった事実(値)」だけを置く列。
   ★ 動詞を繰り返さない(ui.js の mark() 側で値だけを渡すようにした)。
     前は左が「傾きを直しました」右が「2本の傾きを直しました」と同じことを
     二度言い、しかも右が幅に収まらず「ズレ 0.42秒 を合わせま…」と
     肝心の数字の隣で切れていた(実測 161px > 枠 151px)。
     値だけなら 320px でも切れない */
.as-step-sub { flex: 0 1 auto; margin-left: auto; padding-left: 10px; text-align: right;
  max-width: 48%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; color: var(--tx2); font-weight: 600;
  font-variant-numeric: tabular-nums; }
.as-step-sub:empty { padding-left: 0; }

/* うまくいかなかったときの顔。畳まずにこの画面のまま出す */
.as-fail { border: 1px solid rgba(197, 48, 48, .25); border-radius: 14px;
  background: rgba(197, 48, 48, .05); padding: 14px; display: flex;
  flex-direction: column; gap: 8px; }
/* ★ 「うまくいきませんでした」を2回言わない(2026-08-01 実測)。
   fail() が上の見出し(#asHead)を「うまくいきませんでした」に書き替えるので、
   この箱の中の同じ文言と、375px の画面で 500px と離れずに並んでいた ─
   同じ文が二度出るのは、それだけで壊れて見える。
   箱は赤い枠と背景で既に「まずいこと」を伝えているので、
   見出しは落として、いちばん知りたい**止まった場所と理由**から始める */
.as-fail-h { display: none; }
.as-fail-msg { margin: 0; font-size: 14px; font-weight: 700; color: var(--tx); }
.as-fail-msg::before {                 /* 見出しを消したぶん、印だけ残す */
  content: "\f06a";                    /* fa-circle-exclamation */
  font-family: "Font Awesome 6 Free"; font-weight: 900;
  color: #c53030; margin-right: 7px;
}
.as-fail-hint { margin: 0; font-size: 12px; color: var(--tx2); }
.as-fail-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.as-fail-btns .btn { min-height: 44px; }
.as-fail-det { font-size: 12px; color: var(--tx2); }
.as-fail-det summary { min-height: 32px; display: flex; align-items: center; cursor: pointer; }
.as-fail-copy { min-height: 44px; width: 100%; margin: 6px 0 0; }
/* ★ 文字が読めなかった(2026-08-02 実機。白地に白)。
   .btn の既定色を継がずに、この場で必ず読める色を指定する */
/* 完成画面の出口。主役(保存)より静かに、しかし44ptは確保する */
.eo-exit { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
/* ★ hidden属性より display:flex が勝つ罠の封じ(2026-08-02)。書き出し実行中は
   ui.js が出口を隠す ─ 「最初から作り直す」は再読込リンクで、実行中の
   誤タップは書き出しの即死。iOS Safari は beforeunload の確認も出さない */
.eo-exit[hidden] { display: none !important; }
.eo-tools, .eo-share-tool { min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; text-decoration: none; }
/* ★ 「このツールを友達にシェア」(2026-08-02)。動画そのものの共有(主ボタン=塗り)と
   ひと目で別物と分かる形にする: 塗らない・アイコンが違う・出口の側にある。
   同じ緑や青の塗りにすると「保存」と取り違える(いま直したばかりの事故と同型) */
.eo-share-tool { font-size: 13px; font-weight: 600; }
.eo-share-tool i { color: var(--acc); }
/* ★ 保存が済んだら、シェアを保存バンドの直下へ持ち上げて目立たせる
   (2026-08-02 優さん指示⑥「ツールをシェアをもっと目立つように」)。
   主従は 保存(塗り) > シェア(枠+薄い塗り) > その他(ghost) ─
   主役の保存より強くしない(塗り切らない・アクセントは枠と文字色まで) */
.eo-share-tool.share-lift {
  border: 1.5px solid var(--acc); color: var(--acc);
  background: rgba(30, 79, 214, .06); font-size: 14px; font-weight: 700;
}

.as-fail-copy, #audioWarnCopy, .mzp-retry {
  background: #fff !important; color: var(--acc) !important;
  border: 1px solid rgba(30, 79, 214, .35) !important; font-weight: 700; }
.as-fail-log { margin: 6px 0 0; padding: 8px; max-height: 200px; overflow: auto;
  background: rgba(15, 33, 56, .05); border-radius: 8px;
  font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
  -webkit-user-select: text; user-select: text; }
/* ★ 失敗したら、用済みになったものを畳む(2026-08-01 レビュー実測)。
   実測で失敗時の中身は 1034px = 375×635 画面の1.6倍あり、
   「うまくいきませんでした」の見出しが画面の外に落ちていた。
   削るべきは説明ではなく、**失敗して用済みになったもの**のほう */
.auto-stage.as-failed .as-steps,
.auto-stage.as-failed .as-bar,
.auto-stage.as-failed .as-meta,
.auto-stage.as-failed #asWhat { display: none; }
.auto-stage.as-failed .as-preview canvas { max-height: 96px; }
/* 止まったのだから、動くものは全部止める */
.auto-stage.as-failed .as-step i,
.auto-stage.as-failed .as-bar-fill { animation: none !important; }
.as-step.failed { color: var(--tx); }
.as-step.failed i { background: rgba(197, 48, 48, .14); color: #c53030; }

/* 「同じ演奏の動画ですか？」の2択(2026-08-02)。失敗の赤ではなく問いの青。
   出し入れ・畳み方は as-failed と同じ規則(用済みのものを畳み、動きを止める) */
.as-ask { border-color: rgba(30, 79, 214, .28); background: rgba(30, 79, 214, .05); }
.as-ask .as-fail-msg::before { content: "\f059"; color: var(--acc); }  /* fa-circle-question */
.auto-stage.as-asking .as-steps,
.auto-stage.as-asking .as-bar,
.auto-stage.as-asking .as-meta,
.auto-stage.as-asking #asWhat { display: none; }
.auto-stage.as-asking .as-preview canvas { max-height: 96px; }
.auto-stage.as-asking .as-step i,
.auto-stage.as-asking .as-bar-fill { animation: none !important; }

/* 画面が消えると止まる、の案内。読み飛ばされない濃さにする */
.as-wake { margin: -2px 0 0; padding: 8px 10px; border-radius: 10px;
  background: rgba(197, 138, 0, .12); color: var(--tx); font-size: 12px; line-height: 1.5; }

@keyframes asPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.86); } }
@keyframes asPop { 0% { transform: scale(.5); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

.as-cancel { align-self: center; min-height: 44px; color: var(--tx2); }

/* ============ 完成の瞬間(2026-08-01) ============
   finishAll() のあと 700ms だけ映る、5〜9分かけた仕事の顔。
   青い進行中の色のまま畳まれると「途中で消えた」としか見えないので、
   ここだけは色を変えて「終わった」と言い切る。
   待ち方の案内と「やめる」は、もう用が無いので引っ込める */
.auto-stage.as-complete .as-bar-fill {
  background: linear-gradient(90deg, var(--ok), #35b97a);
  transition: width .3s ease, background .3s ease;
}
.auto-stage.as-complete .as-pct { color: var(--ok); }
.auto-stage.as-complete .as-wait,
.auto-stage.as-complete .as-cancel,
.auto-stage.as-complete #asEta { display: none; }
.auto-stage.as-complete #asHead { color: var(--ok); }

/* ============ 縦向きの小さい画面(2026-08-01 実測) ============
   実測 320x568 で 119px はみ出し、「やめる」と最後の段が画面の外にあった
   (iPhone SE も browser chrome を引くと 553px でここに入る)。
   スクロールできるとはいえ、3〜9分ずっと見ている画面で
   「できていってる」の下半分を毎回スクロールさせるのは違う。
   プレビューは主役なので最後に削り、まず余白と装飾から詰める */
@media (max-height: 660px) and (max-width: 699px) {
  .as-step { padding: 3px 4px; }        /* 34px → 28px ×6段 = 36px 節約 */
  #asWhat { display: none; }            /* 何を頼んだかは開始前の画面で読んでいる */
  .as-inner { gap: 6px; }
  .auto-stage #cv { max-height: 27vh; }   /* ID込みで名乗る(上の注記と同じ理由) */
  .as-title { font-size: 16px; }
  .as-wait { font-size: 11px; line-height: 1.45; }
}

/* ============ 横向き・低い画面(2026-08-01 実測) ============
   実測 812x375 で中身が 584px あり、**209px はみ出していた**。
   「やめる」は画面の 193px 下、段のチェックも下半分が見えない ─
   いちばん見せたい「できていってる」が視野の外にあった。
   一方で幅は 812px あるのに中身は 520px で止まり、292px を捨てていた。
   縦に積むのをやめ、左=プレビュー / 右=進み具合 の2列にする */
@media (max-height: 560px) and (min-width: 700px) {
  /* ★ row-gap は 0 にして、行の間隔は右の列の margin で作る(2026-08-01 実測)。
     プレビューを縦に通すため grid-row を span で伸ばすが、暗黙の行には
     -1 が使えないので多めに span する。このとき row-gap を持たせると
     **中身が無い行にも隙間が入る** ─ span 99 + row-gap 8px で
     実測 725px の空白が生まれた(直前の 209px 溢れより悪化した)。
     row-gap 0 なら空の行は高さも隙間も 0 で消える */
  .as-inner { max-width: 940px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-items: start; column-gap: 22px; row-gap: 0; }
  .as-preview { grid-column: 1; grid-row: 1 / span 20; align-self: center; width: 100%; }
  /* 横向きは高さがすべて。左の列は画面の高さいっぱいまで使う
     (ID込みで名乗る ─ でないと #cv の 35vh=131px に潰される) */
  .auto-stage #cv { max-height: calc(100vh - 34px); }
  /* 右の列: 見出しから「やめる」までを、書いてある順に積む */
  .as-title, #asWhat, #asWake, .as-bar, .as-meta, .as-steps, .as-wait, .as-cancel,
  .as-fail { grid-column: 2; margin-top: 0; margin-bottom: 8px; }
  /* grid では align-self は縦方向なので、素の .as-cancel の align-self:center が
     効かず「やめる」が右の列いっぱいに伸びていた。控えめな脇役に戻す */
  .as-cancel { margin-bottom: 0; justify-self: center; min-width: 140px; }
  /* 高さが足りないぶんは余白と文字寸法から削る。
     削るのは装飾であって、段の名前と値は削らない */
  .as-step { padding: 3px 4px; font-size: 13px; }
  .as-title { font-size: 15px; }
  .as-pct { font-size: 12px; }
  .as-eta { font-size: 17px; }
  #asWhat { display: none; }   /* 何をおまかせしたかは縦向きで読めている */
  .as-wait { font-size: 11px; }
  .auto-stage { padding-top: calc(10px + env(safe-area-inset-top, 0px));
                padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  /* 失敗したら2列は要らない(プレビューは用済み)。2択(as-asking)も同じ */
  .auto-stage.as-failed .as-inner,
  .auto-stage.as-asking .as-inner { display: flex; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .as-bar-fill { transition: none; }
  .as-step i { animation: none !important; }
}

/* ★ 種類を選ぶ画面の案内(2026-08-05 優さん指示)。
   「フルショウはパソコンから」と「右上にロゴが入る」を、選ぶ前に伝える。
   カードより前に読ませたいが主役ではないので、文字は小さく行間は広く */
.mode-tip {
  max-width: 34rem; margin: 8px auto 0; padding: 10px 12px;
  border-radius: 10px; background: var(--panel2); border: 1px solid var(--line);
  color: var(--tx2); font-size: 12.5px; line-height: 1.7; text-align: left;
}
.mode-tip i { margin-right: 7px; color: var(--acc); }
.mode-tip b { color: var(--tx); }
/* ★ ロゴの断りは #modeSelect の外(無料の帯の直下)へ出した(2026-08-05 優さん指示)。
   .mode-select が持っていた左右の余白(16px)が効かなくなるので、ここで自前に持つ。
   375px で端に張り付かないよう、auto ではなく左右16pxを明示する */
.mode-tip--logo {
  background: transparent; border-style: dashed;
  margin: 8px 16px 0; max-width: calc(34rem - 32px);
}
@media (min-width: 608px) {
  /* 34rem+32px を超えたら中央寄せに戻す(帯と同じ見え方にそろえる) */
  .mode-tip--logo { margin: 8px auto 0; max-width: 34rem; }
}
@media (max-width: 460px) {
  .mode-tip { font-size: 12px; padding: 9px 11px; }
}
