/*
 * テーマトークン層（分離条件(a): 純CSS変数・製品ロジック非含有＝中立コピー可資産）
 * :root = 既定皮 midgray-blue（A6 ミッドグレー #4a4a52 × B2 ブルー #4a9eff）
 * html[data-theme="dark-orange"] = 旧皮（Stage A 実測で現行と 0px 一致する値）
 * 状態色（赤/アンバー/緑）と黒白オーバーレイは各所リテラルのまま据え置き（テーマ非依存）
 */
/* 根治: HTML の hidden 属性は常に隠す。display:flex/grid を持つ要素で hidden が効かない
   バグ(体験版バナー等)の温床を汎用で封じる。個別 .xxx[hidden] のモグラ叩きを廃し正攻法に統一。
   :not([hidden]) で表示制御する要素(cloud-auth-dialog 等)とも両立(hidden時のみ none)。 */
[hidden] { display: none !important; }

:root {
  /* ── 中立トークン（両皮で同値）── */
  --foreground: #f1f1f2;
  --text-muted: #bdbdc1;
  --selection: #3a6df0;
  --video: #4a6cf0;
  --caption: #2d8a5e;
  --bgm: #8458c4;
  --radius: 6px;

  /* ── テーマ可変トークン：既定 = midgray-blue ── */
  --background: #303137;
  --muted: #3b3c43;
  --muted-2: #44454d;
  --muted-3: #4a4a52;          /* A6 anchor */
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.20);
  --text-subtle: #adadb3;
  --text-faint: #949499;
  --accent: #4a9eff;           /* B2 */
  --accent-foreground: #061a30;
  --accent-rgb: 74, 158, 255;  /* rgba影が青に追従 */
  --accent-2: #2f86e6;         /* グラデ相方（深め青） */
  /* surface ladder（midgray: #4a4a52 を軸に持ち上げ） */
  --surface-0: #202127;
  --surface-1: #24252b;
  --surface-2: #2a2b31;
  --surface-3: #2e2f35;
  --surface-4: #313238;
  --surface-5: #33343a;
  --surface-6: #3e3f47;
  --surface-7: #404149;
  --surface-8: #42434b;
  --surface-9: #45464e;
  --surface-10: #494a53;
  --line-1: #5a5b64;
  --line-2: #6f7079;
}

/* ── 旧皮：ダーク＋オレンジ（切替で選択可・現行値そのまま）── */
/* ── ★新皮：ダーク（黒）＋ブルー（城野の指定 2026-08-04・§191）──
   ★面は dark-orange の黒系をそのまま使い、★アクセントは :root の青を【継承する】
   （--accent 系を上書きしない＝1箇所で管理・二重定義しない）。
   ★城野のダーク原則: ①純黒#000は使わない ②階層は面の明るさで作る ③アクセントは青1色
   ④枠線を減らす ⑤余白と文字のウェイトで序列。★①③は満たす（背景#1a1a1b・青1色）。 */
html[data-theme="dark-blue"] {
  --background: #1a1a1b;
  --muted: #202021;
  --muted-2: #272728;
  --muted-3: #2e2e30;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text-subtle: #86868b;
  --text-faint: #5a5a5e;
  --surface-0: #0b0b0c;
  --surface-1: #0d0d0e;
  --surface-2: #161617;
  --surface-3: #181819;
  --surface-4: #1b1b1c;
  --surface-5: #1c1c1e;
  --surface-6: #232325;
  --surface-7: #242425;
  --surface-8: #252526;
  --surface-9: #262627;
  --surface-10: #2c2c2e;
  --line-1: #3a3a3c;
  --line-2: #54545a;
}

html[data-theme="dark-orange"] {
  --background: #1a1a1b;
  --muted: #202021;
  --muted-2: #272728;
  --muted-3: #2e2e30;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text-subtle: #86868b;
  --text-faint: #5a5a5e;
  --accent: #ff9f0a;
  --accent-foreground: #1a1208;
  --accent-rgb: 255, 159, 10;
  --accent-2: #ff7a00;
  --surface-0: #0b0b0c;
  --surface-1: #0d0d0e;
  --surface-2: #161617;
  --surface-3: #181819;
  --surface-4: #1b1b1c;
  --surface-5: #1c1c1e;
  --surface-6: #232325;
  --surface-7: #242425;
  --surface-8: #252526;
  --surface-9: #262627;
  --surface-10: #2c2c2e;
  --line-1: #3a3a3c;
  --line-2: #54545a;
}

/* ── クラウド皮：ホワイト＋ブルー（文字起こし=読む/書く作業の明るい作業トーン・Notta/V社準拠）──
   nekomoji_cloud の既定。背景=白/オフホワイト・文字=濃色・アクセント=青・罫線=薄グレー。WCAG AA配慮。 */
html[data-theme="white-blue"] {
  --foreground: #1b1b22;       /* 濃色本文（白背景でAA） */
  --text-muted: #55555f;
  --text-subtle: #6e6e78;
  --text-faint: #9096a0;
  --background: #ffffff;
  --muted: #f4f5f7;
  --muted-2: #f7f8fa;
  --muted-3: #eef0f3;
  --border: rgba(0, 0, 0, 0.10);       /* 薄グレー罫線 */
  --border-strong: rgba(0, 0, 0, 0.16);
  --accent: #3b82f6;           /* 柔らかい青（城野調整）。白文字ボタンは大/太字AA(3.0)を満たす。※小文字の青はAA-normal(4.5)未満 */
  --accent-foreground: #ffffff;
  --accent-rgb: 59, 130, 246;
  --accent-2: #2f6fd6;
  --surface-0: #eef0f3;
  --surface-1: #f5f6f8;
  --surface-2: #f0f1f4;
  --surface-3: #ffffff;        /* ワークスペースの白キャンバス */
  --surface-4: #f0f1f4;
  --surface-5: #ffffff;
  --surface-6: #ffffff;
  --surface-7: #f9fafb;        /* TOPヘッダー帯 */
  --surface-8: #f7f8fa;
  --surface-9: #eef0f3;
  --surface-10: #f0f1f4;
  --line-1: #dfe1e6;
  --line-2: #c8cbd2;
}

/* クラウド皮ホワイト専用: 黒オーバーレイ据え置きリテラル(行/入力欄の凹み)を白背景用に上書き。
   ダーク皮(dark-orange/midgray-blue)は一切不変(この上書きは white-blue のときだけ効く)。 */
html[data-theme="white-blue"] .transcribe-row,
html[data-theme="white-blue"] .compose-material,
html[data-theme="white-blue"] .compose-chunk,
html[data-theme="white-blue"] .compose-correction,
html[data-theme="white-blue"] .compose-dropped-row,
html[data-theme="white-blue"] .compose-replace-hits p,
html[data-theme="white-blue"] .compose-result,
html[data-theme="white-blue"] .compose-segments button {
  background: #f6f7f9;
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="white-blue"] .transcribe-edit,
html[data-theme="white-blue"] .transcribe-edit textarea,
html[data-theme="white-blue"] .compose-setting input,
html[data-theme="white-blue"] .compose-setting select,
html[data-theme="white-blue"] .speaker-name-inputs input,
html[data-theme="white-blue"] .compose-replace input,
html[data-theme="white-blue"] .compose-edit-box textarea {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.14);
}
/* 状態/意味色の据え置きリテラルを白背景で可読に（アンバー=修正案/リンク, 赤=エラー, 緑=合格）。ダーク皮は不変 */
html[data-theme="white-blue"] .compose-correction b,
html[data-theme="white-blue"] .compose-link-button,
html[data-theme="white-blue"] .compose-result a { color: #a86400; }
html[data-theme="white-blue"] .credit-copy strong,
html[data-theme="white-blue"] .credit-overview p.is-empty,
html[data-theme="white-blue"] .compose-edit-delete,
html[data-theme="white-blue"] .saved-project-empty.is-error,
html[data-theme="white-blue"] .compose-result .is-fail { color: #c0392b; }
html[data-theme="white-blue"] .compose-result .is-pass { color: #1a7f4b; }

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--surface-1);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  letter-spacing: 0;
}

/* クラウド皮(NEKOCUT_PRODUCT=nekomoji_cloud): 独立製品の姿=エディタchromeを隠し、
   文字起こしワークスペース(app-shellの兄弟・position:fixed)を全画面表示する */
body.is-cloud-product > .app-shell { display: none; }
/* FOUC根治: bodyクラス(app.js末尾で付与=遅い)より前に、head先読みのhtmlクラスで描画前から隠す(二重防御) */
html.is-cloud .app-shell { display: none; }

/* クラウド皮: ワークスペースを「浮いた箱(モーダル)」ではなく画面いっぱいの独立製品にする。
   見出し(script-header)が画面上端の帯=TOP になる。角丸/枠/影/余白を落として full-bleed。 */
body.is-cloud-product .transcribe-workspace { padding: 0; }
/* grid-template-columns明示(城野裁定 2026-07-13・ヘッダー折返し修正の前提): 指定なしだと
   auto トラックが子(.script-shell 幅100%)のmax-content(=折返し無し前提の最大幅)で
   トラック自体を広げてしまい、ヘッダーが常に横1列に収まって折返しが発火しない循環が起きる。
   1frで固定してから初めて .cloud-header-right の flex-wrap が効く。 */
body.is-cloud-product .transcribe-workspace { grid-template-columns: 1fr; }
/* クラウド皮: タイトル帯(script-header)とステッパー(①②③)は cloud-header と冗長=非表示にして
   作業エリア(ツールバー+プレビュー+字幕リスト)を画面上端まで引き上げる(Vrew型)。 */
body.is-cloud-product .transcribe-workspace .script-header,
body.is-cloud-product .transcribe-workspace .workflow-steps {
  display: none;
}
body.is-cloud-product .transcribe-workspace .script-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* クラウド皮のアプリヘッダー(V社ライク最小限・白地+薄い下罫線+青アクセント) */
.cloud-header { display: none; }
body.is-cloud-product .cloud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 10px 20px;
  background: var(--surface-3);
  border-bottom: 0.5px solid var(--border);
}
.cloud-header-left { display: flex; align-items: center; gap: 14px; }
.cloud-logo {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;           /* 正式ロゴ(白地に青K)を角丸で表示。背景塗りはロゴ画像に任せる */
  background: #fff;
}

.cloud-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.cloud-brand { color: var(--foreground); font-size: 14.5px; font-weight: 700; }
.cloud-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 6px 13px;
  border: 0.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.cloud-back:hover { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), 0.04); }
.cloud-back[hidden] { display: none; }   /* hidden属性を display:inline-flex より優先 */
.cloud-header-right { display: flex; align-items: center; gap: 8px; }
.cloud-balance {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--muted);
}
.cloud-icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.cloud-icon-btn:hover { background: var(--muted); color: var(--accent); }
.cloud-start-btn {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cloud-start-btn:hover { filter: brightness(1.06); }
.cloud-start-btn[hidden] { display: none; }
/* 始めるボタンの文言をレスポンシブ切替(城野裁定 2026-07-13): 広い画面=「KUGINAを始める」/
   スマホ(≤640px)=「始める」。長い文言でヘッダーが2段化しFAQが単独で回り込むのを防ぎ、1段に維持。 */
.cloud-start-short { display: none; }
.cloud-login-btn {
  padding: 6.5px 15px;
  border: 0.5px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.cloud-login-btn:hover { border-color: var(--accent); color: var(--accent); }
.cloud-login-btn[hidden] { display: none; }
.cloud-plan-btn {
  padding: 6px 13px;
  border: 0.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.cloud-plan-btn:hover { border-color: var(--accent); color: var(--accent); }
.cloud-plan-btn[hidden] { display: none; }
.cloud-balance[hidden] { display: none; }
body.is-cloud-product [data-auth-logout].cloud-icon-btn[hidden] { display: none; }

/* クラウド ログインダイアログ(white-blue) */
.cloud-auth-dialog { display: none; }
.cloud-auth-dialog:not([hidden]) {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 80;
}
.cloud-auth-backdrop { position: absolute; inset: 0; background: rgba(20, 25, 35, 0.35); }
.cloud-auth-card {
  position: relative;
  width: min(400px, calc(100vw - 32px));
  display: grid;
  gap: 12px;
  padding: 28px 26px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.cloud-auth-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-subtle);
  font-size: 18px;
  cursor: pointer;
}
.cloud-auth-x:hover { background: var(--muted); }
.cloud-auth-title { color: var(--foreground); font-size: 17px; }
.cloud-auth-sub { color: var(--text-subtle); font-size: 12.5px; line-height: 1.5; }
.cloud-auth-card .auth-google {
  margin-top: 4px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.cloud-auth-card .auth-google:hover { filter: brightness(1.06); }
.cloud-auth-or,
.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-faint);
  font-size: 11px;
}
.cloud-auth-or::before, .cloud-auth-or::after,
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }

/* スマホ「その他」収納(城野裁定 2026-07-21)。PC=非表示で完全不変 */
.exit-more { display: none; }

/* クラウド皮トースト(城野裁定 2026-07-26): app-shell非表示でsetStatusが不可視になる問題の恒久修正。
   画面下部中央に数秒表示(z-index=210=全ダイアログ/オーバーレイより上)。 */
.cloud-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  z-index: 210;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(20, 22, 28, 0.94);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cloud-toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 復帰オーバーレイ(城野裁定 2026-07-18): 決済/ログイン復帰の初期化中(実測 約5秒)を「処理中」表示に。
   head先読みクラス(is-returning-*)で描画前から出し、loadSettings完了で解除。z-index=200(全ダイアログより上)。 */
html.is-returning-checkout body::before,
html.is-returning-login body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--background, #f8fafc);
  opacity: 0.97;
}
html.is-returning-checkout body::after,
html.is-returning-login body::after {
  position: fixed;
  z-index: 201;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  color: var(--foreground, #1f2937);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  animation: return-pulse 1.4s ease-in-out infinite;
}
html.is-returning-checkout body::after { content: "決済を確認しています…"; }
html.is-returning-login body::after { content: "ログインしています…"; }
@keyframes return-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* キャリアメール不達の誘導注記(城野裁定 2026-07-17: Google主導線化+E文言) */
.auth-carrier-note {
  display: block;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.55;
}
.cloud-auth-card .auth-email-row { display: grid; gap: 8px; }
.cloud-auth-card .auth-email-row input {
  padding: 10px 12px;
  border: 0.5px solid var(--border-strong);
  border-radius: 9px;
  background: #ffffff;
  color: var(--foreground);
  font-size: 13px;
  outline: 0;
}
.cloud-auth-card .auth-email-row input:focus { border-color: var(--accent); }
.cloud-auth-card .auth-email-row button {
  padding: 10px 12px;
  border: 0.5px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.cloud-auth-card .auth-email-row button:hover { border-color: var(--accent); color: var(--accent); }
.cloud-auth-card .auth-message { color: var(--accent); font-size: 11.5px; min-height: 14px; }

/* スマホ配慮(案A・最低限): 崩壊させない + PC(Chrome)推奨の案内。完全レスポンシブは後日 */
.cloud-mobile-note { display: none; }
@media (max-width: 640px) {
  body.is-cloud-product .cloud-mobile-note {
    display: block;
    text-align: center;
    padding: 8px 12px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    font-size: 12px;
    line-height: 1.4;
    border-bottom: 0.5px solid var(--border);
  }
  body.is-cloud-product .cloud-header { padding: 8px 12px; }
  body.is-cloud-product .cloud-brand { display: none; }   /* 狭幅ではロゴのみ残す */
  body.is-cloud-product .cloud-back { margin-left: 2px; padding: 6px 10px; }
  /* 始めるボタン: スマホは短い「始める」に切替(城野裁定 2026-07-13・ヘッダー1段維持) */
  .cloud-start-full { display: none; }
  .cloud-start-short { display: inline; }
  /* ヘッダー右側はみ出し対策(城野裁定 2026-07-13): 横スクロールは使わない(iOSスワイプ根治条件の維持)。
     入り切らない分は折返しで2行目へ。ボタンは全て画面内・タップ可能なまま。 */
  body.is-cloud-product .cloud-header {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  body.is-cloud-product .cloud-header-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
  }
  body.is-cloud-product .transcribe-top-cards { grid-template-columns: 1fr; }
  body.is-cloud-product .transcribe-dropcard { padding: 30px 20px; }
}

/* 画面1: TOP(2択カード・V社ライク=白カード+淡青丸アイコン+薄影+角丸+ゆったり余白) */
.transcribe-top {
  display: none;
  place-items: center;
  min-height: 58vh;
  padding: 24px;
}
.transcribe-top.is-active { display: grid; }
.transcribe-top-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 300px));   /* 入口3カード(城野指示 2026-07-17) */
  gap: 22px;
}
@media (max-width: 760px) { .transcribe-top-cards { grid-template-columns: 1fr; } }
.transcribe-top-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 210px;
  padding: 34px 30px;
  border: 0.5px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-3);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.07);
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.transcribe-top-card:hover,
.transcribe-top-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border-color: var(--accent);
  outline: 0;
}
.transcribe-top-card.is-secondary { background: var(--muted); }
.transcribe-top-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
}
.transcribe-top-card strong { color: var(--foreground); font-size: 17px; }
.transcribe-top-card span { color: var(--text-subtle); font-size: 12.5px; line-height: 1.5; }
.transcribe-top-hint { margin: 18px 0 0; color: var(--text-subtle); font-size: 12px; text-align: center; }
.transcribe-privacy-note { margin: 14px auto 0; max-width: 560px; color: var(--text-subtle); font-size: 12px; text-align: center; line-height: 1.6; }

/* 体験版エントリ(TOP・目立たせる) */
.transcribe-demo-banner {
  display: flex; align-items: center; gap: 14px; width: 100%; max-width: 620px;
  margin: 0 auto 18px; padding: 16px 20px; cursor: pointer; text-align: left;
  border: 1px solid transparent; border-radius: 14px; color: var(--accent-foreground);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.transcribe-demo-banner:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.36); }
.transcribe-demo-icon {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255, 255, 255, 0.22); font-size: 16px;
}
.transcribe-demo-text { display: flex; flex-direction: column; gap: 3px; }
.transcribe-demo-text strong { font-size: 15px; }
.transcribe-demo-text span { font-size: 12px; opacity: 0.92; }

/* 体験版バナー(レビュー画面・CTA+プライバシー) */
.demo-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.10);
}
.demo-banner-badge {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700;
  color: var(--accent-foreground); background: var(--accent);
}
.demo-banner-text { flex: 1; min-width: 180px; font-size: 12.5px; color: var(--foreground); line-height: 1.5; }
.demo-banner-cta {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  color: var(--accent-foreground); background: var(--accent); border: 0;
}
.demo-banner-cta:hover { background: var(--accent-2); }

/* 履歴C: 保存した文字起こしの一覧 */
.transcribe-history-list { max-width: 620px; margin: 16px auto 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.history-row { display: flex; align-items: stretch; gap: 6px; }
.history-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--muted, transparent); color: inherit;
}
.history-open:hover { border-color: var(--accent); }
.history-open strong { font-size: 14px; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-open span { font-size: 11.5px; color: var(--text-subtle); }
.history-delete {
  flex: 0 0 auto; width: 38px; border: 1px solid var(--border); border-radius: 10px; background: transparent;
  color: var(--text-subtle); cursor: pointer; font-size: 16px;
}
.history-delete:hover { border-color: var(--state-error, #e5484d); color: var(--state-error, #e5484d); }

/* 履歴D/Vrew案A: 復元時の動画選択プロンプト */
.transcribe-video-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px; margin-bottom: 12px; border: 1px dashed var(--border-strong, var(--border));
  border-radius: 12px; background: var(--muted, rgba(0, 0, 0, 0.03));
}
.transcribe-video-pick-hint { font-size: 12.5px; color: var(--text-subtle); line-height: 1.6; }
.transcribe-video-pick-btn {
  padding: 8px 16px; border: 0; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--accent-foreground); background: var(--accent);
}
.transcribe-video-pick-btn:hover { background: var(--accent-2); }
.transcribe-video-pick-ref { font-size: 12px; color: var(--foreground); opacity: 0.85; }

/* ── クラウド皮: 動画投入画面を V社ライクの魅力に ── */
/* 軽いステップインジケーター(青ベタ帯をやめる・現在地だけ淡青ピル・細い繋ぎ線) */
body.is-cloud-product .transcribe-workspace .workflow-steps {
  display: none;   /* ステッパー(①②③)は非表示=cloud-headerと冗長・作業エリアを上端まで引き上げる */
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 8px 14px 4px;
  background: transparent;
}
body.is-cloud-product .transcribe-workspace .workflow-steps span {
  min-height: auto;
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 700;
}
body.is-cloud-product .transcribe-workspace .workflow-steps span.is-done { color: var(--text-subtle); }
body.is-cloud-product .transcribe-workspace .workflow-steps span.is-active {
  color: #fff;
  background: var(--accent);
}
body.is-cloud-product .transcribe-workspace .workflow-steps span:not(:last-child)::after {
  content: "";
  width: 26px;
  height: 1.5px;
  margin: 0 6px;
  border-radius: 2px;
  background: var(--border-strong);
}

/* 動画投入ステージ: ドロップカードを画面の縦中央に(下半分の虚無を解消・主役化) */
body.is-cloud-product .transcribe-workspace [data-transcribe-stage="input"].is-active {
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.is-cloud-product .transcribe-input-center {
  width: 100%;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* 「置きたくなる」ドロップカード: イラスト+柔らかい破線+薄影+角丸+ホバー反応 */
body.is-cloud-product .transcribe-dropcard {
  width: min(560px, 100%);
  min-height: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  margin: 0;
  padding: 42px 34px;
  border: 2px dashed rgba(var(--accent-rgb), 0.32);
  border-radius: 20px;
  background: var(--surface-3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
body.is-cloud-product .transcribe-dropcard:hover,
body.is-cloud-product .transcribe-dropcard:focus-visible,
body.is-cloud-product .transcribe-dropcard.is-dragover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.03);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10);
  outline: 0;
}
body.is-cloud-product .transcribe-drop-illust { line-height: 0; margin-bottom: 4px; }
body.is-cloud-product .transcribe-dropcard strong { color: var(--foreground); font-size: 19px; }
body.is-cloud-product .transcribe-dropcard > span { color: var(--text-subtle); font-size: 13px; line-height: 1.5; }
body.is-cloud-product .transcribe-drop-formats {
  margin-top: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--text-subtle);
  font-size: 11px;
}

/* 詳細設定: プレーン文字+三角 → 中央の分かりやすいクリックピルに */
body.is-cloud-product .transcribe-detail { text-align: center; margin-top: 6px; }
body.is-cloud-product .transcribe-detail > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: 0.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
body.is-cloud-product .transcribe-detail > summary::-webkit-details-marker { display: none; }
body.is-cloud-product .transcribe-detail > summary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}
body.is-cloud-product .transcribe-detail[open] > summary { margin-bottom: 14px; }
body.is-cloud-product .transcribe-detail .compose-settings-grid { text-align: left; }

.app-shell {
  width: min(100% - 28px, 1240px);
  height: min(100vh - 28px, 686px);
  height: min(100dvh - 28px, 686px);   /* iOS: アドレスバー分のずれ対策(非対応はvhに留まる) */
  margin: 14px auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.menubar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 38px;
  padding: 7px 13px;
  background: var(--surface-8);
  border-bottom: 0.5px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--foreground);
  font-weight: 700;
}

.brand-mark {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-foreground);
  font-size: 11px;
  font-weight: 800;
}

.desktop-menu {
  display: flex;
  gap: 12px;
  color: var(--text-subtle);
}

.desktop-menu button:hover,
.menu-chip:hover {
  color: var(--foreground);
}

.menubar-spacer {
  flex: 1;
}

.mode-switch {
  display: flex;
  padding: 2px;
  background: var(--muted-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
}

.mode-switch button {
  padding: 3px 9px;
  border-radius: 4px;
  color: var(--text-subtle);
  font-size: 10.5px;
}

.mode-switch button.is-active {
  color: var(--accent-foreground);
  background: var(--accent);
  font-weight: 700;
}

.menu-chip,
.export-button {
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 10.5px;
}

.menu-chip {
  color: var(--text-muted);
  background: var(--muted-2);
  border: 0.5px solid var(--border);
}

.credit-chip {
  min-width: 146px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--muted);
  text-align: left;
}

.credit-chip:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: var(--surface-9);
}

.credit-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2f9e68;
  box-shadow: 0 0 0 3px rgba(47, 158, 104, 0.13);
}

.credit-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.credit-copy strong,
.credit-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-copy strong {
  color: var(--foreground);
  font-size: 10px;
  font-weight: 700;
}

.credit-copy small {
  color: var(--text-faint);
  font-size: 8px;
}

.credit-chip.is-low .credit-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.credit-chip.is-low .credit-copy strong {
  color: var(--accent);
}

.credit-chip.is-empty .credit-dot {
  background: #ff5a5a;
  box-shadow: 0 0 0 3px rgba(255, 90, 90, 0.16);
}

.credit-chip.is-empty .credit-copy strong {
  color: #ff8a8a;
}

.credit-chip.is-unset .credit-dot,
.credit-chip.is-loading .credit-dot {
  background: #72727a;
  box-shadow: 0 0 0 3px rgba(114, 114, 122, 0.13);
}

.export-menu {
  position: relative;
}

.export-button {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-weight: 700;
}

.export-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  min-width: 168px;
  display: none;
  padding: 5px;
  background: var(--surface-6);
  border: 0.5px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.52);
}

.export-menu.is-open .export-dropdown {
  display: grid;
  gap: 2px;
}

.export-dropdown button {
  width: 100%;
  padding: 7px 8px;
  text-align: left;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
}

.export-dropdown button:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.06);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 212px minmax(420px, 1fr) 278px;
}

.left-rail,
.center-stage,
.right-rail {
  min-width: 0;
  min-height: 0;
}

.left-rail {
  display: flex;
  flex-direction: column;
  border-right: 0.5px solid var(--border);
}

.center-stage {
  display: flex;
  flex-direction: column;
  border-right: 0.5px solid var(--border);
}

.right-rail {
  display: flex;
  flex-direction: column;
}

.section-label {
  padding: 8px 11px;
  color: var(--text-subtle);
  border-bottom: 0.5px solid var(--border);
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.library-list {
  padding: 7px 6px;
  border-bottom: 0.5px solid var(--border);
}

.saved-project-list {
  display: grid;
  gap: 5px;
  max-height: 212px;
  overflow: auto;
  margin-bottom: 6px;
}

.saved-project-row {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  background: var(--muted-2);
  text-align: left;
}

.saved-project-row:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.07);
}

.saved-project-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
}

.saved-project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--text-subtle);
  font-size: 9px;
  line-height: 1.4;
}

.saved-project-meta em {
  font-style: normal;
}

.saved-project-empty {
  padding: 9px;
  border: 0.5px dashed var(--border);
  border-radius: 6px;
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.02);
  font-size: 10px;
  line-height: 1.5;
}

.saved-project-empty.is-error {
  color: #ffb3b3;
  border-color: rgba(255, 79, 79, 0.45);
  background: rgba(255, 79, 79, 0.08);
}

.library-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: left;
}

.library-item:hover,
.asset-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.library-item.is-selected {
  color: var(--foreground);
  background: rgba(58, 109, 240, 0.22);
}

.library-item.child {
  padding-left: 20px;
  color: var(--text-subtle);
  font-size: 10.5px;
}

.library-item.create {
  color: var(--accent);
}

.bin-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  border-bottom: 0.5px solid var(--border);
}

.bin-panel .section-label {
  padding: 0;
  margin-bottom: 7px;
  border: 0;
}

.file-input {
  display: none;
}

.upload-button {
  width: 100%;
  margin-bottom: 6px;
  padding: 7px 8px;
  border: 0.5px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 5px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 10.5px;
  text-align: left;
}

.mini-status {
  margin-bottom: 7px;
  color: var(--text-faint);
  font-size: 8.5px;
}

.asset-list {
  display: grid;
  gap: 4px;
}

.asset-row {
  width: 100%;
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 39px;
  margin-bottom: 4px;
  padding: 5px;
  border: 0.5px solid transparent;
  border-radius: 5px;
  text-align: left;
}

.asset-row:hover {
  border-color: var(--border);
}

.asset-row strong,
.asset-row small {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-row strong {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
}

.asset-row small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 8.5px;
}

.thumb {
  width: 44px;
  height: 27px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: linear-gradient(135deg, #2c2c2e, #0b0b0c);
}

.thumb-b {
  background: linear-gradient(135deg, #273147, #111315);
}

.thumb-c {
  background: linear-gradient(135deg, #332820, #0c0c0d);
}

.script-panel {
  height: 182px;
  padding: 9px;
  display: flex;
  flex-direction: column;
}

.script-panel h2 {
  margin: 0 0 1px;
  color: var(--foreground);
  font-size: 11px;
}

.script-panel p {
  margin: 0 0 7px;
  color: var(--text-faint);
  font-size: 8.5px;
}

.script-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.script-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  margin-bottom: 3px;
  padding: 5px 6px;
  background: var(--muted-2);
  border: 0.5px solid transparent;
  border-radius: 4px;
  text-align: left;
}

.script-row:hover {
  border-color: var(--border-strong);
}

.script-row.is-current {
  background: var(--muted-3);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
}

.grip {
  color: var(--text-faint);
  font-size: 11px;
}

.badge {
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-subtle);
  background: var(--line-1);
  font-size: 8px;
  white-space: nowrap;
}

.script-row.is-current .badge {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.16);
}

.line {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duration {
  color: var(--text-faint);
  font-size: 8px;
}

.viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: var(--surface-0);
}

.preview-frame {
  position: relative;
  height: min(100%, 312px);
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0.5px solid var(--border-strong);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, #090909 0%, #000 100%);
}

.preview-frame.is-landscape {
  aspect-ratio: 16 / 9;
  width: min(78%, 520px);
  height: auto;
}

.play-button {
  color: #48484a;
  font-size: 30px;
}

.preview-frame.has-video {
  background: #000;
}

.preview-frame.has-video .play-button,
.preview-frame.has-video .preview-caption {
  display: none;
}

.preview-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.viewer-badge,
.viewer-zoom {
  position: absolute;
  top: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-subtle);
  background: rgba(0, 0, 0, 0.55);
  font-size: 8.5px;
}

.viewer-badge {
  left: 9px;
}

.viewer-zoom {
  right: 9px;
}

.preview-caption {
  position: absolute;
  right: 8px;
  bottom: 34px;
  left: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
}

.timeline {
  padding: 9px 13px 12px;
  background: var(--surface-2);
  border-top: 0.5px solid var(--border);
}

.transport {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  color: var(--text-subtle);
}

.transport button:hover {
  color: var(--foreground);
}

.transport .main-play {
  color: var(--foreground);
  font-size: 15px;
}

.scrubber {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line-1);
}

.scrubber .fill {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.scrubber .handle {
  position: absolute;
  left: 30%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.timecode {
  color: var(--text-subtle);
  font-size: 10px;
}

.ruler {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 0 2px;
  color: var(--line-2);
  font-size: 7.5px;
}

.track {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.track-icon {
  width: 13px;
  color: var(--text-faint);
  text-align: center;
}

.text-track {
  font-weight: 800;
}

.blocks {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 2px;
}

.clip {
  min-width: 0;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 5px;
  overflow: hidden;
  border-radius: 3px;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip.video {
  color: #dde4ff;
  background: var(--video);
}

.clip.caption {
  height: 15px;
  background: var(--caption);
}

.clip.caption.is-current {
  outline: 1.5px solid var(--accent);
}

.w-10 { flex: 1; }
.w-12 { flex: 1.2; }
.w-15 { flex: 1.5; }
.w-16 { flex: 1.6; }
.w-17 { flex: 1.7; }

.bgm-lane {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.bgm-clip {
  flex: 1;
  min-width: 0;
  height: 15px;
  padding-left: 6px;
  border-radius: 3px;
  color: #ece2fb;
  background: var(--bgm);
  font-size: 8px;
  text-align: left;
}

.speaker {
  color: var(--text-subtle);
  font-size: 10px;
}

.volume {
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-1);
}

.volume span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: var(--text-subtle);
}

.inspector {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 0.5px solid var(--border);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 8px 9px 0;
  border-bottom: 0.5px solid var(--border);
}

.tab {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 5px 5px 0 0;
  color: var(--text-subtle);
  font-size: 13px;
}

.tab:hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.tab.is-active {
  color: var(--accent);
  background: var(--muted-2);
  border: 0.5px solid var(--border);
  border-bottom: 0;
  font-weight: 700;
}

.inspector-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 11px;
  background: var(--muted-2);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.inspector-title {
  margin-bottom: 11px;
  color: var(--text-subtle);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.field-label {
  display: block;
  margin: 11px 0 5px;
  color: var(--text-subtle);
  font-size: 9.5px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.preset {
  padding: 4px 7px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--muted-3);
  font-size: 9px;
}

.preset.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

.select-like {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  color: var(--foreground);
  background: var(--muted-3);
  font-size: 10.5px;
}

.select-like span:last-child {
  color: var(--text-faint);
}

.swatches {
  display: flex;
  gap: 5px;
}

.swatch {
  width: 20px;
  height: 20px;
  border: 1.5px solid transparent;
  border-radius: 4px;
}

.swatch.is-active {
  border-color: #fff;
}

.white { background: #fff; }
.yellow { background: #ffe14d; }
.red { background: #ff5a5a; }
.blue { background: #4dd2ff; }
.black { background: #111; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.slider {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line-1);
}

.slider span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.slider-value {
  width: 30px;
  color: var(--text-subtle);
  font-size: 9px;
  text-align: right;
}

.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.position-grid button {
  height: 17px;
  border: 0.5px solid var(--border);
  border-radius: 3px;
  background: var(--muted-3);
}

.position-grid button.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

.placeholder-stack {
  display: grid;
  gap: 8px;
}

.placeholder-stack span {
  padding: 8px;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  background: var(--muted-3);
}

.duration-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.duration-row button {
  padding: 5px 4px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  background: var(--muted-3);
  font-size: 9px;
}

.duration-row button.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

.key-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-bottom: 14px;
}

.key-field .field-label,
.key-field span {
  grid-column: 1 / -1;
}

.key-field input {
  min-width: 0;
  padding: 7px 8px;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  color: var(--foreground);
  outline: 0;
  background: var(--muted-3);
  font-size: 10px;
}

.key-field button {
  padding: 7px 9px;
  border-radius: 5px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.key-field span {
  color: var(--text-subtle);
  font-size: 9px;
}

.credit-settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px;
  border: 0.5px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.07);
}

.credit-settings-card div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.credit-settings-card strong {
  color: var(--foreground);
  font-size: 10.5px;
}

.credit-settings-card span {
  color: var(--text-subtle);
  font-size: 8.5px;
}

.credit-settings-card button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 9px;
  font-weight: 700;
}

.auth-panel {
  display: grid;
  gap: 8px;
  margin-top: 9px;
  margin-bottom: 14px;
  padding: 9px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--muted-3);
}

.auth-panel[hidden] {
  display: none;
}

.auth-copy {
  display: grid;
  gap: 3px;
}

.auth-copy strong {
  color: var(--foreground);
  font-size: 10.5px;
}

.auth-copy span,
.auth-copy small,
.auth-message {
  color: var(--text-subtle);
  font-size: 8.5px;
  line-height: 1.45;
}

.auth-copy small,
.auth-message {
  color: var(--text-faint);
}

.auth-actions {
  display: grid;
  gap: 6px;
}

.auth-google,
.auth-logout {
  width: 100%;
  padding: 7px 8px;
  border-radius: 5px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.auth-logout {
  color: var(--text-muted);
  border: 0.5px solid var(--border);
  background: var(--muted-2);
}

.auth-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.auth-email-row[hidden] {
  display: none;
}

.auth-email-row input {
  min-width: 0;
  padding: 7px 8px;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  color: var(--foreground);
  outline: 0;
  background: var(--muted-2);
  font-size: 10px;
}

.auth-email-row button {
  padding: 7px 8px;
  border-radius: 5px;
  color: var(--text-muted);
  border: 0.5px solid var(--border);
  background: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
}

.auth-email-row button:hover,
.auth-logout:hover {
  border-color: var(--accent);
  color: var(--foreground);
}

.plan-auth-panel {
  margin: 0 0 12px;
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.24);
}

.claude-prompt {
  padding: 10px 11px;
  background: var(--surface-2);
}

.prompt-title {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  color: var(--text-faint);
  font-size: 9px;
}

.prompt-title span,
.spark {
  color: var(--accent);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}

.prompt-chips button {
  padding: 3px 8px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--muted-2);
  font-size: 9px;
}

.prompt-chips button:hover {
  color: var(--foreground);
  border-color: var(--accent);
}

.silence-cut-card {
  display: grid;
  gap: 7px;
  margin-bottom: 8px;
  padding: 8px;
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.silence-cut-head {
  display: grid;
  gap: 2px;
}

.silence-cut-head span {
  color: var(--foreground);
  font-size: 10px;
  font-weight: 700;
}

.silence-cut-head small {
  color: var(--text-faint);
  font-size: 8.5px;
  line-height: 1.35;
}

.silence-cut-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.silence-cut-controls label {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  color: var(--text-subtle);
  background: var(--muted-2);
  font-size: 8.5px;
}

.silence-cut-controls input {
  min-width: 0;
  width: 100%;
  color: var(--foreground);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
  text-align: right;
}

.silence-cut-controls span {
  color: var(--text-faint);
}

.silence-cut-button {
  width: 100%;
  padding: 6px 7px;
  border-radius: 5px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
}

.silence-cut-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.silence-cut-result {
  min-height: 13px;
  color: var(--text-faint);
  font-size: 8.5px;
  line-height: 1.35;
}

.pipeline-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 7px;
}

.pipeline-actions button {
  min-width: 0;
  padding: 6px 4px;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  background: var(--muted-2);
  font-size: 9.5px;
}

.pipeline-actions button:first-child,
.pipeline-actions button:not(:disabled):hover {
  color: var(--accent-foreground);
  background: var(--accent);
}

.pipeline-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pipeline-status {
  min-height: 15px;
  margin-bottom: 7px;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.4;
}

.download-link {
  display: block;
  margin: -2px 0 7px;
  color: var(--accent);
  font-size: 9px;
  text-decoration: none;
}

.prompt-box {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 0.5px solid var(--border-strong);
  border-radius: 7px;
  background: var(--muted-2);
}

.prompt-box input {
  min-width: 0;
  flex: 1;
  color: var(--foreground);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.prompt-box input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

.prompt-box button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 11px;
}

.plan-dialog[hidden] {
  display: none;
}

.plan-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;   /* ★クラウド全画面ワークスペース(.script-workspace z-index:60)より上に。50だと覆われて開いても見えない不具合の修正 */
  display: grid;
  place-items: center;
}

.plan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.plan-panel {
  position: relative;
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 42px);
  max-height: calc(100dvh - 42px);   /* iOS: アドレスバー対策 */
  overflow: auto;
  padding: 16px;
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--background);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.66);
}

.plan-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.plan-header p {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.plan-header h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 18px;
}

.plan-header button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-subtle);
  background: var(--muted-2);
  font-size: 18px;
}

.credit-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 0.5px solid var(--border);
  border-radius: 7px;
  background: var(--muted);
}

.credit-overview div {
  display: grid;
  gap: 2px;
}

.credit-overview span {
  color: var(--text-faint);
  font-size: 9px;
}

.credit-overview strong {
  color: var(--foreground);
  font-size: 15px;
}

.credit-overview p {
  max-width: 390px;
  margin: 0;
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.55;
}

.credit-overview p.is-low {
  color: var(--accent);
}

.credit-overview p.is-empty {
  color: #ff8a8a;
}

.credit-overview p.is-unset {
  color: var(--text-subtle);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.plan-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--muted);
}

.plan-card.is-featured {
  border-color: rgba(var(--accent-rgb), 0.44);
  background: rgba(var(--accent-rgb), 0.08);
}

.plan-card.is-current {
  outline: 1px solid var(--accent);
}

.plan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-card-top span {
  color: var(--foreground);
  font-size: 12px;
  font-weight: 700;
}

.plan-card-top em {
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.plan-card strong {
  color: var(--foreground);
  font-size: 20px;
}

.plan-card strong small {
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 500;
}

.plan-card p {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.plan-card > span {
  min-height: 30px;
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.5;
}

.plan-card button {
  height: 28px;
  border-radius: 6px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.plan-card button:disabled {
  cursor: default;
  opacity: 0.55;
}

.plan-footnote {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 0.5px solid var(--border);
  color: var(--text-faint);
  font-size: 10px;
}

.project-choice-dialog[hidden],
.script-workspace[hidden] {
  display: none;
}

.project-choice-dialog,
.script-workspace {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.project-choice-dialog {
  display: grid;
  place-items: center;
}

.project-choice-panel {
  position: relative;
  width: min(520px, calc(100vw - 28px));
  padding: 16px;
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--background);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.66);
}

.project-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.project-choice-grid button {
  min-height: 128px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--muted-2);
  text-align: left;
}

.project-choice-grid button:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.07);
}

.project-choice-grid span {
  color: var(--accent);
  font-size: 18px;
}

.project-choice-grid strong {
  color: var(--foreground);
  font-size: 14px;
}

.project-choice-grid small {
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.5;
}

.script-workspace {
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.64);
}

.script-shell {
  width: min(100%, 1180px);
  height: min(100%, 700px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-3);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.66);
}

.script-header {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 13px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface-7);
}

.script-header p {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.script-header h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 16px;
}

.script-header > button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-subtle);
  background: var(--muted-2);
  font-size: 18px;
}

.script-steps {
  display: flex;
  gap: 5px;
}

.script-steps span {
  padding: 4px 8px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  color: var(--text-subtle);
  background: var(--muted-2);
  font-size: 9px;
}

.script-steps span.is-active {
  color: var(--accent-foreground);
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 800;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 14px 0;
}

.workflow-steps span {
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-subtle);
  background: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
}

.workflow-steps span.is-done {
  color: var(--foreground);
  border-color: rgba(var(--accent-rgb), 0.26);
  background: rgba(var(--accent-rgb), 0.07);
}

.workflow-steps span.is-active {
  color: var(--accent-foreground);
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 900;
}

.next-action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 14px 0;
  padding: 11px 12px;
  border: 0.5px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.08);
}

.next-action-panel[hidden] {
  display: none;
}

.next-action-panel strong,
.confirm-next-step strong {
  display: block;
  color: var(--foreground);
  font-size: 12px;
}

.next-action-panel span {
  display: block;
  margin-top: 3px;
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.45;
}

.next-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.next-action-buttons button,
.confirm-next-step button {
  padding: 8px 11px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
}

.next-action-buttons button.primary,
.confirm-next-step button.primary {
  color: var(--accent-foreground);
  border-color: var(--accent);
  background: var(--accent);
}

.script-stage {
  flex: 1;
  min-height: 0;
  display: none;
  overflow: auto;
  padding: 16px;
}

.script-stage.is-active {
  display: block;
}

.script-stage-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.script-stage-copy strong {
  color: var(--foreground);
  font-size: 15px;
}

.script-stage-copy span {
  color: var(--text-subtle);
  font-size: 10.5px;
}

.script-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.script-type-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--muted-2);
  text-align: left;
}

.script-type-card:hover,
.script-type-card.is-selected {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.07);
}

.script-type-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  font-size: 16px;
}

.script-type-card strong {
  color: var(--foreground);
  font-size: 12px;
}

.script-type-card span:last-child {
  color: var(--text-subtle);
  font-size: 10px;
  line-height: 1.45;
}

.script-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.script-form-notice {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 0.5px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--foreground);
  font-size: 11px;
  line-height: 1.55;
}

.script-field {
  display: grid;
  gap: 5px;
}

.script-field.is-large {
  grid-column: 1 / -1;
}

.script-field label {
  color: var(--text-subtle);
  font-size: 9.5px;
}

.script-field input,
.script-field select,
.script-field textarea,
.script-chat-box textarea {
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  outline: 0;
  background: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.script-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-subtle) 50%), linear-gradient(135deg, var(--text-subtle) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.script-field textarea {
  min-height: 84px;
  resize: vertical;
}

.script-field.is-large textarea {
  min-height: 154px;
}

.script-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.script-stage[data-script-stage="form"] .script-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 12px 0 0;
  background: linear-gradient(180deg, rgba(28, 28, 30, 0), var(--panel) 34%);
}

.script-operation-status {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0.5px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 6px;
  color: var(--foreground);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 11px;
  line-height: 1.45;
}

.script-operation-status[hidden] {
  display: none;
}

.script-operation-status.is-error {
  border-color: rgba(255, 79, 79, 0.45);
  background: rgba(255, 79, 79, 0.1);
  color: #ffb3b3;
}

.script-spinner {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  border-radius: 999px;
  animation: script-spin 0.8s linear infinite;
}

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

.script-actions button,
.script-chat-panel > button {
  padding: 8px 11px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
}

.script-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.script-actions button:disabled,
.script-chat-panel button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.script-actions button.primary,
.script-chat-panel > button.primary {
  color: var(--accent-foreground);
  border-color: var(--accent);
  background: var(--accent);
}

.script-stage-draft.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
}

.script-document-panel,
.script-chat-panel,
.script-confirm-card {
  min-width: 0;
  min-height: 0;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--muted-2);
}

.script-document-panel {
  display: flex;
  flex-direction: column;
}

.script-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border);
}

.script-panel-head strong,
.script-chat-panel > strong,
.script-confirm-card strong {
  color: var(--foreground);
  font-size: 12px;
}

.script-panel-head span {
  color: var(--accent);
  font-size: 9px;
}

.script-panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.script-panel-tools button {
  padding: 5px 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--panel);
  font-size: 9px;
  font-weight: 700;
}

.script-panel-tools button:hover {
  color: var(--accent-foreground);
  border-color: var(--accent);
  background: var(--accent);
}

.script-document {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.script-document h1,
.script-document h2,
.script-document h3 {
  color: var(--foreground);
  line-height: 1.35;
}

.script-document h1 {
  font-size: 19px;
}

.script-document h2 {
  margin-top: 18px;
  font-size: 15px;
}

.script-document h3 {
  margin-top: 14px;
  font-size: 13px;
}

.script-document code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-4);
}

.script-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px;
}

.script-chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
}

.script-chat-message {
  padding: 7px 8px;
  border-radius: 7px;
  color: var(--text-muted);
  background: var(--muted-3);
  font-size: 10px;
  line-height: 1.45;
}

.script-chat-message.is-user {
  color: var(--accent-foreground);
  background: rgba(var(--accent-rgb), 0.82);
}

.script-chat-box {
  display: grid;
  gap: 6px;
}

.script-chat-box textarea {
  min-height: 92px;
  resize: vertical;
}

.script-chat-box button {
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.script-confirm-card {
  max-width: 700px;
  display: grid;
  gap: 8px;
  margin: 36px auto 0;
  padding: 18px;
}

.script-confirm-card span,
.script-confirm-card small {
  color: var(--text-subtle);
  line-height: 1.55;
}

.confirm-next-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 8px;
  padding: 12px;
  border: 0.5px solid rgba(var(--accent-rgb), 0.42);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.08);
}

.confirm-next-step button {
  width: fit-content;
}

.script-stage-compose.is-active {
  display: block;
  overflow: auto;
}

.compose-workspace {
  display: grid;
  gap: 14px;
}

.compose-panel {
  border: 0.5px solid var(--border);
  background: var(--muted-2);
  border-radius: 8px;
  padding: 14px;
}

.compose-material,
.compose-review-head,
.compose-chunk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compose-material {
  margin: 12px 0;
  padding: 10px 12px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.compose-material-slots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compose-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  margin: 12px 0;
  padding: 22px 16px;
  border: 2px dashed rgba(var(--accent-rgb), 0.5);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.05);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.compose-dropzone strong {
  color: var(--foreground);
  font-size: 15px;
}

.compose-dropzone span {
  color: var(--text-muted);
  font-size: 12px;
}

.compose-dropzone-icon {
  font-size: 22px;
  color: var(--accent);
}

.compose-dropzone:hover,
.compose-dropzone:focus-visible {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.09);
}

.compose-dropzone.is-dragover {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(var(--accent-rgb), 0.16);
  transform: scale(1.01);
}

.compose-dropzone.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.compose-dropzone-mini {
  min-height: 70px;
  margin: 8px 0 0;
  padding: 12px;
  border-width: 1.5px;
}

.compose-dropzone-mini strong {
  font-size: 12px;
}

.compose-dropzone-mini span {
  font-size: 10px;
}

.compose-srt-option {
  margin: 4px 0 10px;
}

.compose-srt-option summary {
  color: var(--text-subtle);
  font-size: 11px;
  cursor: pointer;
}

.compose-settings {
  margin: 4px 0 6px;
}

.compose-settings summary {
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.compose-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  padding: 10px 2px 4px;
}

.compose-setting {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.compose-setting input[type="number"],
.compose-setting input[type="text"],
.compose-setting select {
  padding: 6px 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
}

.compose-setting-wide {
  grid-column: 1 / -1;
}

.compose-setting-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.speaker-name-inputs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.speaker-name-inputs input {
  flex: 1;
  min-width: 90px;
  max-width: 170px;
  padding: 6px 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.25);
  font-size: 12px;
}

.compose-edit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* hidden属性を display:flex より優先(候補が出る前は反映/採用/取消ボタンを隠す=AI校正パネルをすっきり) */
.compose-edit-actions[hidden] { display: none; }

.compose-edit-delete {
  color: #ff8a8a;
  background: rgba(255, 90, 90, 0.08);
  border-color: rgba(255, 90, 90, 0.3);
}

.compose-undo-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.compose-preview {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 8px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);   /* 不透明: 裏を通過するリストが透けて汚れないように */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.compose-preview video {
  width: 100%;
  /* 小さいウィンドウでも出口バーと交差しないよう画面高に連動 */
  max-height: clamp(140px, 26vh, 230px);
  border-radius: 6px;
  background: #000;
}

/* sticky帯(上=プレビュー/下=出口バー)に隠れないよう、自動スクロール位置を補正 */
.compose-segments button,
.compose-chunk,
.compose-correction,
.transcribe-row {
  scroll-margin-top: 300px;
  scroll-margin-bottom: 90px;
}

.compose-preview small {
  color: var(--text-subtle);
  font-size: 10px;
}

.compose-preview-missing {
  margin: 10px 0;
  padding: 10px 12px;
  border: 0.5px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.compose-segments button.is-playing {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
}

.compose-segments button.is-playing em {
  color: var(--accent);
}

/* ── 文字起こし専用タブ ── */
.transcribe-entry {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 10px;
  color: var(--foreground);
  background: rgba(var(--accent-rgb), 0.08);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.transcribe-entry:hover {
  background: rgba(var(--accent-rgb), 0.14);
}

.transcribe-entry span:nth-child(2) {
  font-size: 14px;
  font-weight: 800;
}

.transcribe-entry small {
  color: var(--text-subtle);
  font-size: 10px;
}

/* 出口バー(憲法2-1: スクロール位置に関わらず出口が視界内・下部固定)
   交差時はプレビュー(z-index:5)より上に整然と乗る(背景不透明・出口操作を最優先) */
.exit-bar {
  position: sticky;
  bottom: 0;
  z-index: 7;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 10px 0 0;
  padding: 10px;
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-5);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
}

.exit-bar .primary {
  font-size: 14px;
  padding: 10px 16px;
  color: var(--accent-foreground);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);   /* 出口=主ボタン(アクセント色・他と同化させない) */
  cursor: pointer;
  font-family: inherit;
}

.exit-bar .exit-main {
  font-size: 15px;
  font-weight: 800;
  padding: 12px 18px;
}

.exit-bar .primary:hover {
  filter: brightness(1.08);
}

/* 出口バーの副形式ボタン(XML/FCPXML): メニューを廃止しフラット並記(被りゼロ) */
.exit-bar .exit-sub {
  font-size: 12.5px;
  padding: 10px 12px;
  color: var(--foreground);
  border: 0.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-10);
  cursor: pointer;
  font-family: inherit;
}

.exit-bar .exit-sub:hover {
  background: var(--line-1);
}

/* SRT出口=Premiere/DaVinci導線(城野裁定 2026-07-13): 対象ソフトを可視テキストで明示。
   ツールチップはモバイルで出ないため、メインラベル+ヒントの2段構成にする。 */
.exit-bar .exit-srt {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.2;
}
.exit-srt-hint {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.92;
}

.transcribe-toolbar {
  margin: 10px 0 0;
}

.transcribe-list {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  max-height: 46vh;
  overflow: auto;
}

/* 文字起こしreviewステージ: ステージ自体をスクロールさせないflex列にし、
   リストが残り高さを消費・出口バーは常に流れの末尾=被りが構造的に起きない */
.transcribe-workspace [data-transcribe-stage="review"].is-active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.transcribe-workspace [data-transcribe-stage="review"] .exit-bar {
  position: static;
  flex-shrink: 0;
}

/* ===== V社式ツールバー: 常に細い1本のバー。機能はドロップダウン/ポップオーバーで完結 =====
   ★縦にパネルを展開しない(Vrew厳守)。開いた機能は absolute のポップオーバーで作業エリアに
   重なるだけ=字幕リスト/プレビューを押し下げない。 */
.transcribe-toolbar-top {
  position: relative;
  z-index: 6;
  flex-shrink: 0;         /* バー高さは常に1行ぶんで固定(縦に伸びない) */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0 10px;
  margin-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}

/* 各機能は <details>: サマリー=バー上のピル、中身(.tool-pop)は下にポップオーバー */
.transcribe-toolbar-top > details {
  position: relative;     /* .tool-pop の絶対配置アンカー */
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}
.transcribe-toolbar-top > details > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 0.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.transcribe-toolbar-top > details > summary::-webkit-details-marker { display: none; }
.transcribe-toolbar-top > details > summary::marker { content: ""; }
.transcribe-toolbar-top > details > summary::after {
  content: "▾";
  font-size: 10px;
  opacity: 0.6;
  margin-left: 2px;
}
.transcribe-toolbar-top > details > summary:hover {
  border-color: var(--accent);
  color: var(--foreground);
}
.transcribe-toolbar-top > details[open] > summary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-foreground);
}

/* ★AI校正=βの目玉。常時アクセントで一目で分かる目立つボタンに */
.transcribe-toolbar-top > details[data-transcribe-proofread-panel] > summary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-foreground);
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.35);
}
.transcribe-toolbar-top > details[data-transcribe-proofread-panel][open] > summary {
  filter: brightness(0.94);
}

/* ポップオーバー本体: バー直下に絶対配置で重ねる(作業エリアを押し下げない) */
.transcribe-toolbar-top > details > .tool-pop { display: none; }
.transcribe-toolbar-top > details[open] > .tool-pop {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 300px;
  max-width: min(680px, 92vw);
  max-height: 62vh;
  overflow: auto;
  padding: 16px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.30);
}
/* 右寄りのピル(表示設定)は右端合わせで画面外に出さない */
.transcribe-toolbar-top > details[data-compose-settings][open] > .tool-pop {
  left: auto;
  right: 0;
  min-width: 260px;
}
/* 焼き付けスタイル: Vrewの「Noto Sans JP▼ 100▼」のように、1行のインラインdropdownで完結 */
.toolbar-style {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}
.toolbar-style[hidden] { display: none; }
.toolbar-style-icon { font-size: 14px; opacity: 0.85; }
.toolbar-sel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-subtle);
  white-space: nowrap;
}

.burn-size-input {
  width: 52px;
  padding: 2px 4px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--foreground);
  font-size: 12px;
}

.burn-pos-slider {
  width: 96px;
  accent-color: var(--accent);
}
.toolbar-sel > select {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 6px;
  max-width: 130px;
  border: 0.5px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--foreground);
  cursor: pointer;
}
.toolbar-sel > select:hover { border-color: var(--accent); }

/* 焼き付け実行ランタイム(進捗/警告): ツールバー直下・書き出し中のみ表示 */
.burn-runtime {
  flex-shrink: 0;
  display: grid;
  gap: 8px;
  margin: 4px 0 10px;
  padding: 12px 14px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
}
.burn-runtime[hidden] { display: none; }

/* 焼き付け完了カード(緑=保存の合図。青の「書き出す」ボタンと区別して目立たせる) */
.burn-done-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 14px 18px;
  border: 1.5px solid #34c759;
  border-radius: 14px;
  background: rgba(52, 199, 89, 0.10);
}

.burn-done-close {
  min-width: 32px;
  min-height: 30px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-subtle);
  font-size: 13px;
  cursor: pointer;
  flex: none;
}

.burn-share-btn {
  padding: 8px 12px;
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--foreground);
  font-size: 13px;
  cursor: pointer;
  flex: none;
}
.burn-done-card[hidden] { display: none; }
.burn-done-check { font-size: 24px; line-height: 1; }
.burn-done-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.burn-done-text strong { font-size: 15px; color: var(--foreground); }
.burn-download-note { font-size: 12px; color: var(--text-subtle); }
.burn-download-btn {
  flex-shrink: 0;
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: #34c759;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(52, 199, 89, 0.35);
}
.burn-download-btn:hover { filter: brightness(0.96); }

/* AI校正 3モード選択(字幕向け/読みやすく/文書向け)+ 用途説明 */
.preset-row.proofread-modes { flex-wrap: wrap; gap: 6px; }
.proofread-mode-desc {
  margin: 6px 0 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-subtle);
}

/* ===== ラインアイコン統一(Lucide/MIT・絵文字を廃し量産SaaS感を排除) =====
   mask + background-color:currentColor で、ボタンのテキスト色(青/白/グレー/赤)に自動追従。 */
.transcribe-toolbar-top > details > summary::before,
[data-burn-open]::before,
[data-burn-start]::before,
.compose-edit-delete::before,
[data-proofread-undo]::before,
.transcribe-detail > summary::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 7px;
  vertical-align: -3px;
  background-color: currentColor;
  -webkit-mask: var(--ln) center / contain no-repeat;
          mask: var(--ln) center / contain no-repeat;
}
/* AI校正=sparkles */
.transcribe-toolbar-top > details[data-transcribe-proofread-panel] > summary {
  --ln: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z'/%3E%3Cpath d='M20 3v4'/%3E%3Cpath d='M22 5h-4'/%3E%3Cpath d='M4 17v2'/%3E%3Cpath d='M5 18H3'/%3E%3C/svg%3E");
}
/* 一括置換=arrow-left-right */
.transcribe-toolbar-top > details[data-transcribe-replace-panel] > summary {
  --ln: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3 4 7l4 4'/%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='m16 21 4-4-4-4'/%3E%3Cpath d='M20 17H4'/%3E%3C/svg%3E");
}
/* 表示設定=sliders-horizontal */
.transcribe-toolbar-top > details[data-compose-settings] > summary,
.transcribe-detail > summary {
  --ln: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='21' x2='14' y1='4' y2='4'/%3E%3Cline x1='10' x2='3' y1='4' y2='4'/%3E%3Cline x1='21' x2='12' y1='12' y2='12'/%3E%3Cline x1='8' x2='3' y1='12' y2='12'/%3E%3Cline x1='21' x2='16' y1='20' y2='20'/%3E%3Cline x1='14' x2='14' y1='2' y2='6'/%3E%3Cline x1='8' x2='8' y1='10' y2='14'/%3E%3Cline x1='16' x2='16' y1='18' y2='22'/%3E%3C/svg%3E");
}
/* AI校正を取り消す=undo-2 */
[data-proofread-undo] {
  --ln: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5 5.5 5.5 0 0 1-5.5 5.5H11'/%3E%3C/svg%3E");
}
/* 書き出し系=film */
[data-burn-open], [data-burn-start] {
  --ln: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2'/%3E%3Cpath d='M7 3v18'/%3E%3Cpath d='M3 7.5h4'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M3 16.5h4'/%3E%3Cpath d='M17 3v18'/%3E%3Cpath d='M17 7.5h4'/%3E%3Cpath d='M17 16.5h4'/%3E%3C/svg%3E");
}
/* この字幕を消す=trash(色はボタンの赤に追従) */
.compose-edit-delete {
  --ln: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6'/%3E%3Cpath d='M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2'/%3E%3Cline x1='10' x2='10' y1='11' y2='17'/%3E%3Cline x1='14' x2='14' y1='11' y2='17'/%3E%3C/svg%3E");
}
/* インラインSVGアイコン(スタイル群・ヘッダー)のサイズ */
.toolbar-style-icon svg { width: 15px; height: 15px; display: block; }
.cloud-icon-btn svg { width: 16px; height: 16px; display: block; }

/* ===== 確認画面2カラム: 左=プレビュー(sticky固定)+編集 / 右=字幕リスト(主役・広く) ===== */
.transcribe-columns {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 20px;   /* V社トーンのゆったり感: カラム間に余白 */
  align-items: stretch;
}

/* 左はプレビュー+編集のみに縮小(機能は上へ移動)。右の字幕リストを主役として広く取る */
.transcribe-col-left {
  flex: 0 0 clamp(300px, 34%, 440px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

/* ★プレビューは左カラム内でsticky固定: 編集/AI校正を下にスクロールしても動画が常に見える
   (左カラム自体がoverflow-y:auto=スクロール枠なので、その上端にpinする) */
.transcribe-col-left .compose-preview {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
  /* 裏を通過する編集/校正が透けないよう不透明背景(base .compose-preview の surface-2 を継承) */
}

.transcribe-col-left .compose-preview video {
  /* プレビューは主役として大きく(Vrew型・上部の空き帯を使う)。sticky固定で常に見える */
  max-height: clamp(280px, 48vh, 560px);
}

.transcribe-col-left .transcribe-edit,
.transcribe-col-left .compose-settings {
  margin: 0;
}

.transcribe-col-right {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.transcribe-col-right .transcribe-list {
  flex: 1;
  min-height: 60px;
  max-height: none;
  margin-top: 0;
  align-content: start;
}

/* 字幕検索バー: リスト上部に固定。検索窓+件数+前/次/クリア */
.transcribe-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted, rgba(0, 0, 0, 0.03));
  flex: 0 0 auto;
}
.transcribe-search .t-search-icon {
  width: 15px;
  height: 15px;
  color: var(--text-subtle, #888);
  flex: 0 0 auto;
}
.transcribe-search input[data-t-search-input] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  outline: none;
  padding: 2px 0;
}
.transcribe-search .t-search-count {
  font-size: 11.5px;
  color: var(--text-subtle, #888);
  white-space: nowrap;
  min-width: 30px;
  text-align: right;
}
.transcribe-search .t-search-nav {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-subtle, #888);
  cursor: pointer;
  line-height: 1;
  font-size: 11px;
  padding: 0;
}
.transcribe-search .t-search-nav:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 検索ヒットのハイライト(表示テキスト内) */
mark.t-hit {
  background: rgba(var(--accent-rgb), 0.28);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
/* 現在ヒット行を強調 */
.transcribe-row.is-search-current {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ★再生追従(§240改・城野裁定「オレンジ=いま再生されている字幕」が正しい仕様):
   再生中の行を選択行と同じオレンジで光らせ、リストも追従する。 */
.transcribe-row.is-playing {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* リストは独自スクロールでsticky帯が無い=大きなscroll-marginは追従スクロールを壊すため打ち消す */
.transcribe-col-right .transcribe-row {
  scroll-margin-top: 4px;
  scroll-margin-bottom: 4px;
}

/* 狭い画面: 縦積みフォールバック(2カラムが潰れない下限=900px) */
@media (max-width: 900px) {
  /* ★スマホ=アプリ型固定レイアウト(2026-07-10・業界標準: YouTube/Vrew/CapCut式)。
     画面は固定(パネルスクロール廃止)。動画+編集欄は常に上・字幕リストだけが独立スクロール
     (YouTubeのコメント欄式)・下は横スクロールのスリム1行アクションバー。PC(>900px)は不変。 */
  .script-stage.is-active[data-transcribe-stage="review"] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .transcribe-columns {
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;   /* ★visibleだと狭い実機でcol-rightがはみ出しexit-barと重なる(実測) */
  }

  .burn-runtime {
    flex: none;
  }

  .transcribe-col-left {
    /* ★配分(城野裁定 2026-07-21実機確認後): リストは5行で頭打ち→余った高さはプレビューが
       全部もらう(grow)。高さ不足時は従来どおりプレビューが先に縮む(shrink 10)。 */
    flex: 1 10 auto;
    min-height: 152px;   /* 映像88px+チェック行(はみ出させない)。豆粒化させない下限 */
    overflow: hidden;
  }

  .transcribe-col-right {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  /* 字幕リスト=独立スクロール(YouTubeコメント式)。ここだけが上下に動く */
  .transcribe-col-right .transcribe-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* スタイル列(フォント/大きさ/文字色/フチ/位置)は横スワイプで全項目に届く(見切れ解消) */
  .toolbar-style {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 下部バー: 折返しで全ボタン常時表示(iOS実機で横スワイプの慣性がタップを消費し
     SRT等が「押しても無反応」になった実バグの根治=スワイプ不要にする)。注記は非表示 */
  .exit-bar {
    position: static;
    flex: none;
    flex-wrap: wrap;
    overflow-x: visible;   /* 横スクロール禁止を維持(iOSスワイプがタップを消費する実バグの根治条件) */
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
    box-shadow: none;
  }
  /* ★主要2+その他方式(城野裁定 2026-07-21): 常時=[書き出す][コピー][その他▾]の1行のみ。
     SRT/XML/FCPXML/別の動画は「その他」ポップに収納(機能維持・複製ボタン+委譲リスナー)。
     横スクロールは使わない=iOSスワイプバグ根治条件の維持。 */
  .exit-bar {
    gap: 6px;
    padding: 7px;
    margin-top: 6px;
    flex-wrap: nowrap;
  }
  .exit-bar > .exit-sub,
  .exit-bar > [data-dl-pick],
  .exit-bar > [data-transcribe-again],
  .exit-bar > [data-transcribe-copy-text] { display: none; }   /* 直下の収納対象のみ(ポップ内は表示)。★copy-textもその他へ収納(城野 2026-07-26: 書き出すボタンを切らさない) */
  .exit-bar button {
    min-width: 0;
    font-size: 11.5px;
    padding: 9px 6px;
    white-space: nowrap;
  }
  .exit-bar > [data-burn-open] { flex: 3 1 auto; }   /* ★copy-textをその他へ収納した分、主役(書き出す)をさらに優先=文言を切らない(城野 2026-07-26) */
  .exit-more {
    display: block;
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
  }
  .exit-more > summary {
    list-style: none;
    display: block;
    text-align: center;
    padding: 9px 6px;
    border: 0.5px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
  }
  .exit-more > summary::-webkit-details-marker { display: none; }
  .exit-more > summary::marker { content: ""; }
  .exit-more-pop {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 40;
    display: grid;
    gap: 6px;
    min-width: 232px;
    padding: 8px;
    border: 0.5px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-2, #fff);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  }
  .exit-more-pop button {
    width: 100%;
    padding: 11px 10px;
    font-size: 12px;
    white-space: normal;   /* ポップ内は幅に余裕=折返し許可 */
  }


  .exit-bar .exit-main {
    flex: 2 1 auto;   /* 1行バーの主役(書き出す)。basis=autoで文言を切らない。SRT側は非表示 */
    font-size: 12px;
    padding: 9px 6px;
  }

  .exit-bar .free-note {
    display: none;
  }

  /* ★縦詰め(2026-07-10)+クロップ禁止(城野裁定 2026-07-21): コンテナ縮小時は映像全体が
     アスペクト比維持で縮小(object-fit:contain)。縦動画の左右黒帯除去(width:auto)と両立。 */
  .transcribe-col-left .compose-preview {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }
  .transcribe-col-left .compose-preview .preview-video-wrap {
    flex: 1 1 auto;
    min-height: 88px;   /* 映像の最低高(豆粒化防止)。これ以下には潰さずリスト側が5行保証で均衡 */
    display: flex;
    justify-content: center;
    align-items: center;   /* 既定stretchだと横動画のheight:autoが引き伸ばされ上下黒帯(実測) */
  }
  .transcribe-col-left .compose-preview video {
    /* 城野裁定 2026-07-21: リスト5行の余りを映像が使う。width/heightともauto+max制限=
       要素ボックスが常に映像アスペクト(縦の左右黒帯・横の上下黒帯どちらも出ない) */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    min-height: 0;
    object-fit: contain;   /* 保険(縮小時も映像全体を表示=クロップ禁止) */
  }
  /* review作業画面ではPC推奨バナーを畳む(既に使えている人に不要・リスト行数を優先) */
  body.is-cloud-product:has(.script-stage.is-active[data-transcribe-stage="review"]) .cloud-mobile-note {
    display: none;
  }
  /* ★焼き付け完了カード(城野報告 2026-07-22: 横flexのままだとボタン2つがはみ出し・文字が
     縦潰れ)。スマホは縦積み: 見出し行(アイコン+文字=横書き)→ボタン全幅×2 */
  .burn-done-card {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  .burn-done-text { flex: 1 1 60%; }
  .burn-done-text strong,
  .burn-done-text .burn-download-note { white-space: normal; writing-mode: horizontal-tb; }
  .burn-done-card .burn-download-btn,
  .burn-done-card .burn-share-btn {
    flex: 1 1 100%;
    width: 100%;
    white-space: normal;
    padding: 12px 10px;
    font-size: 14px;
  }

  .preview-foot small {
    display: none;   /* ヒント文は非表示(トグルは残す) */
  }

  .transcribe-columns {
    gap: 10px;
  }

  .transcribe-toolbar-top {
    gap: 6px;
    padding: 6px 0;
    margin-bottom: 6px;
  }
  /* ★再配分(城野裁定 2026-07-19): 機能ピル3つ(校正/翻訳/置換)を等幅1行に(縦3段化がリストを
     圧死させていた)。フォントバー(burn-style)は全幅で次段=従来どおり。wrap維持=潰れない。 */
  .transcribe-toolbar-top > details:not([data-burn-style]) {
    flex: 1 1 30%;
    min-width: 0;
  }
  .transcribe-toolbar-top > details[data-burn-style] {
    flex: 1 1 100%;
  }
  .transcribe-toolbar-top > details > summary {
    width: 100%;
    justify-content: center;
    padding: 8px 6px;
    font-size: 12px;
    white-space: nowrap;
  }
  .pill-long { display: none; }   /* スマホは「AI校正」に短縮(PCは結合表示で不変) */
  /* 字幕リスト(本命)の最低高を保証: 検索バー+約5行。プレビュー(shrink10)が先に縮んで吸収する
     ため、この保証がexit-barを箱から溢れさせない(660px級の狭い実機でも被りなし) */
  .transcribe-col-right {
    min-height: 146px;   /* 検索バー+3行。Safari最悪(実効660px)でも被りゼロ */
    max-height: 154px;   /* ★3行で頭打ち(城野裁定 2026-07-21: 5行以内でOK・プレビュー最優先で最大化) */
  }

  .transcribe-search {
    padding: 4px 6px;
    margin-bottom: 6px;
  }

  .transcribe-row {
    padding: 5px 8px;
  }
}

.transcribe-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 10px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.transcribe-row:hover {
  border-color: var(--border-strong);
}

/* 再生中の字幕行=オレンジ枠でハイライト(NekoCut踏襲・white-blueでもオレンジで視認性優先)。
   box-shadowリングで囲むのでレイアウトはズレない。 */
.transcribe-row.is-playing {
  border-color: #ff9500;
  box-shadow: 0 0 0 2px #ff9500;
  background: rgba(255, 149, 0, 0.10);
}

.transcribe-row.is-selected {
  border-color: var(--accent);
}

.transcribe-row.is-deleted span.transcribe-text {
  text-decoration: line-through;
  color: var(--text-faint);
}

/* 2行字幕(max_lines=2)の改行をリスト表示にも反映 */
.transcribe-row .transcribe-text {
  white-space: pre-line;
}

/* ── 焼き付け(方式a・wasm): 同梱OFLフォント5種(実焼きと同じttfでプレビュー) ── */
@font-face { font-family: "NekoBurn Noto"; src: url("/fonts/NotoSansJP-Bold.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Zen"; src: url("/fonts/ZenKakuGothicNew-Bold.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Rounded"; src: url("/fonts/MPLUSRounded1c-Bold.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Mincho"; src: url("/fonts/ShipporiMincho-Bold.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Yusei"; src: url("/fonts/YuseiMagic-Regular.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Klee"; src: url("/fonts/KleeOne-SemiBold.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Dela"; src: url("/fonts/DelaGothicOne-Regular.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Mochiy"; src: url("/fonts/MochiyPopOne-Regular.ttf"); font-display: swap; }
@font-face { font-family: "NekoBurn Reggae"; src: url("/fonts/ReggaeOne-Regular.ttf"); font-display: swap; }

.preview-video-wrap {
  position: relative;
}

/* スタイルプレビュー: 実焼き(libass)のおおよそのCSS近似を映像上に重ねる */
.burn-preview-overlay {
  position: absolute;
  left: 4%;
  right: 4%;
  display: flex;
  justify-content: center;
  text-align: center;
  pointer-events: none;   /* 動画コントロール操作を邪魔しない */
  white-space: pre-line;
  line-height: 1.25;
  font-weight: 700;
}

/* 縦位置は連続値: bottom% はJS(updateBurnOverlay)が実焼きMarginVと同基準で設定 */
.burn-preview-overlay { align-items: flex-end; bottom: 3.5%; }

.burn-panel .burn-note {
  margin: 8px 0 0;
  color: var(--text-subtle);
  font-size: 11px;
}

.burn-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* 実行ボタン=主ボタン(城野審査: パネル内では.primaryのアクセントが当たっていなかった) */
.burn-actions .primary {
  font-size: 14px;
  font-weight: 800;
  padding: 11px 16px;
  color: var(--accent-foreground);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.burn-actions .primary:hover {
  filter: brightness(1.08);
}

.burn-actions .primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.preview-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-subtle);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.burn-estimate {
  color: var(--text-subtle);
  font-size: 11.5px;
}

.burn-warning {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 0.5px solid rgba(var(--accent-rgb), 0.6);
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
}

/* 訂正の自動保存(保存ボタン廃止): 保存された瞬間だけ色で知らせる */
.autosave-hint {
  color: var(--text-subtle);
  font-size: 11px;
}

.autosave-hint.is-saved {
  color: var(--accent);
}

/* 課金原則の明示: 何が無料で何が分数を使うか */
.billing-note {
  margin: 8px 0 0;
  color: var(--text-subtle);
  font-size: 11.5px;
}

.exit-bar .free-note {
  color: var(--text-subtle);
  font-size: 11px;
}

.transcribe-row time {
  flex: none;
  color: var(--text-subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* 字幕行の通し番号(校正候補#と同一index・城野裁定 2026-07-16 案1: TSの左に小さく) */
.transcribe-row .t-no {
  flex: none;
  color: var(--text-faint);
  font-size: 9px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  min-width: 3.2em;   /* #1241(4桁)までTS位置が揃う */
}

/* 校正候補の#番号=ジャンプボタン(リンク風・タップしやすい余白) */
.pf-jump {
  background: none;
  border: 0;
  padding: 1px 2px;
  color: var(--accent);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ジャンプ先の一時ハイライト(約2秒・検索ハイライトと同系のaccent枠) */
.transcribe-row.is-jump-flash {
  animation: t-jump-flash 2.1s ease-out;
}
@keyframes t-jump-flash {
  0%, 55% { outline: 2px solid var(--accent); outline-offset: -2px; }
  100% { outline: 2px solid rgba(0, 0, 0, 0); outline-offset: -2px; }
}

.transcribe-row .transcribe-undo {
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  text-decoration: underline;
}

.transcribe-edit {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding: 10px;
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.transcribe-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.transcribe-edit-close {
  min-width: 34px;
  min-height: 30px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-subtle);
  font-size: 14px;
  cursor: pointer;
}

.transcribe-edit textarea {
  min-height: 52px;
  padding: 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  background: rgba(0, 0, 0, 0.3);
  font: inherit;
  font-size: 13px;
}

.transcribe-edit strong {
  color: var(--text-muted);
  font-size: 11px;
}

.compose-progress {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.compose-progress[hidden] {
  display: none;   /* display:grid が hidden属性より勝ってバーが常時見えるのを防ぐ */
}

.compose-progress progress {
  width: 100%;
  height: 14px;
}

.compose-progress span {
  color: var(--text-muted);
  font-size: 12px;
}

.compose-native-file {
  width: 100%;
  margin: -2px 0 12px;
  padding: 9px;
  border: 0.5px dashed rgba(var(--accent-rgb), 0.45);
  border-radius: 6px;
  color: var(--text-muted);
  background: rgba(var(--accent-rgb), 0.06);
  font-size: 11px;
}

.compose-native-file::file-selector-button {
  margin-right: 10px;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  color: #111;
  background: var(--accent);
  font-weight: 700;
}

.compose-material span,
.compose-review-head span,
.compose-chunk-head span {
  display: block;
  color: var(--text-subtle);
  font-size: 10px;
}

.compose-material strong,
.compose-review-head strong {
  display: block;
  margin-top: 3px;
  color: var(--foreground);
  font-size: 13px;
}

.compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.compose-grid h3 {
  margin: 0 0 8px;
  color: var(--text-subtle);
  font-size: 11px;
}

.compose-chunk-list,
.compose-corrections,
.compose-dropped div {
  display: grid;
  gap: 8px;
}

.compose-chunk,
.compose-correction,
.compose-dropped-row,
.compose-replace-hits p,
.compose-result {
  border: 0.5px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 10px;
}

.compose-chunk.is-closing {
  border-color: rgba(var(--accent-rgb), 0.6);
}

.compose-chunk p,
.compose-dropped-row p,
.compose-replace-hits p,
.compose-result {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.compose-chunk small,
.compose-dropped-row span,
.compose-correction small {
  display: block;
  margin-top: 6px;
  color: var(--text-subtle);
  font-size: 9px;
}

/* ★AI構成案の候補リスト(城野実機 2026-07-31): 旧は .compose-cand が<label>のまま=インラインで横に流れて折り返し、
   1件の区切りが分からず・秒数もバラバラだった(字幕リストの .t-no{min-width}+tabular-nums は .transcribe-row 配下
   のみで compose候補には当たっていない)。★1件1行のグリッドにして [チェック][秒数][確信度][本文/理由] を縦に揃える。
   ★秒数は字幕リストと同じ流儀(固定幅+等幅数字)に共通化。クリックでその場面へ飛ぶ動線は不変(.pf-jumpのまま)。 */
.compose-cand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);   /* [チェック][中身] */
  align-items: start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
}
.compose-cand:nth-child(even) { background: rgba(255, 255, 255, 0.02); }   /* 縞=1件の区切りが分かる */
.compose-cand > span {                          /* 中身=[秒数][確信度][本文] を1行に、理由は本文の下 */
  display: grid;
  grid-template-columns: 4.6em auto minmax(0, 1fr);
  align-items: baseline;
  gap: 3px 8px;
  min-width: 0;
}
.compose-cand .pf-jump { grid-column: 1; }
.compose-cand .ac-conf { grid-column: 2; }
.compose-cand em      { grid-column: 3; }
.compose-cand small   { grid-column: 3; }       /* 理由=本文の真下(同じ列)に揃う */
.compose-cand .pf-jump {
  font-variant-numeric: tabular-nums;                     /* ★等幅数字=桁が変わっても縦が揃う */
  min-width: 4.6em;                                       /* ★「1:00:01.3」「168:55」でも崩れない固定幅 */
  text-align: left;
  padding: 0;
}
.compose-cand em { font-style: normal; line-height: 1.5; overflow-wrap: anywhere; }
.compose-cand small { color: var(--text-subtle); font-size: 10px; line-height: 1.45; }
/* ★AI構成案のポップは候補一覧=✂ピルと同じく広く取り、高さを制限してスクロール(プレビューに被って読めない問題の解消) */
@media (min-width: 641px) {
  [data-transcribe-autocompose-panel] .tool-pop {
    width: min(880px, 92vw);
    max-height: 72vh;
    overflow-y: auto;
  }
}

/* ★タイムライン画面(別画面・城野裁定 2026-07-31: 折り畳みパネル案は却下・上書き)。
   全幅・ルーラー・ズーム・トラック=標準NLEの流儀。描画はdiv絶対配置(canvas不使用)・既存トークン流用。
   ★スマホ(≤640px)は入口も画面も display:none=DOMは足すが1pxも動かさない(✂ピルPC2カラムの流儀)。 */
.timeline-entry { display: none; }               /* 既定=非表示(PCのMQでだけ出す) */
.timeline-workspace { display: none; }
@media (min-width: 641px) {
  .timeline-entry {
    display: flex; align-items: center; gap: 10px;
    margin: 8px 0 2px;
  }
  .timeline-entry .silence-cut-button { width: auto; flex: 0 0 auto; }   /* 主動線を食わない副ボタン扱い */
  .tlw-preview:empty ~ .tlw-body { flex: 1 1 auto; }   /* プレビューが無いときは時間軸で埋める */
  .timeline-workspace:not([hidden]) { display: grid; }
  .timeline-workspace { padding: 0; background: rgba(0, 0, 0, 0.82); }
  .tlw-shell {                                    /* ★全幅(結果画面の1180px枠に収めない=渋滞解消が目的) */
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    background: var(--surface-1);
    overflow: hidden;
  }
  .tlw-head {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    border-bottom: 0.5px solid var(--border-strong);
  }
  .tlw-title { margin: 0; font-size: 14px; font-weight: 600; }
  .tlw-back {
    padding: 5px 12px; border-radius: 6px;
    border: 0.5px solid var(--border-strong); background: var(--surface-2);
    color: inherit; cursor: pointer; font-size: 12px;
  }
  .tlw-back:hover { background: var(--surface-3); }
  .tlw-zoom { display: flex; align-items: center; gap: 4px; }
  .tlw-zoom button {
    min-width: 30px; padding: 4px 8px; border-radius: 6px;
    border: 0.5px solid var(--border-strong); background: var(--surface-2);
    color: inherit; cursor: pointer; font-size: 12px; line-height: 1.2;
  }
  .tlw-zoom button:hover { background: var(--surface-3); }
  .tlw-zoom-label {
    min-width: 92px; text-align: center;
    font-size: 11px; color: var(--text-subtle); font-variant-numeric: tabular-nums;
  }
  .tlw-follow { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-subtle); }
  .tlw-preview {                                  /* 上段=プレビュー(結果画面から移設)。空でも高さを食わない */
    flex: 1 1 auto; min-height: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 10px 14px 0;
  }
  .tlw-preview:empty { display: none; }
  .tlw-preview .preview-video-wrap { max-height: 100%; display: flex; }
  .tlw-preview video { max-height: 100%; max-width: 100%; border-radius: 8px; display: block; object-fit: contain; }
  .tlw-preview .burn-preview-overlay { display: none; }   /* 焼き付けプレビューはこの画面では出さない */
  .tlw-legend { margin: 8px 14px 0; font-size: 11px; flex: 0 0 auto; }
  .tlw-mini {                                     /* ミニマップ=全体を1本のバーに(上部に全体俯瞰・下部に詳細) */
    position: relative; height: 22px; flex: 0 0 auto;
    margin: 8px 14px 0;
    border: 0.5px solid var(--border); border-radius: 5px;
    background: var(--surface-3);
    overflow: hidden; cursor: pointer;
  }
  .tlw-mini-bar { position: absolute; inset: 0; }
  .tl-mini-seg { position: absolute; top: 3px; bottom: 3px; border-radius: 1px; }
  .tlw-mini-view {                                /* いまどこを見ているか(可視窓) */
    position: absolute; top: 0; bottom: 0;
    border: 1px solid var(--accent); border-radius: 3px;
    background: rgba(var(--accent-rgb), 0.14);
    pointer-events: none;
  }
  .tlw-mini-head { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent); pointer-events: none; }
  .tlw-body {                                     /* 左=固定トラック名列 / 右=横スクロールする時間軸 */
    flex: 0 0 auto; max-height: 52vh;             /* 行数ぶんだけ高さを取る(空の黒帯を作らない) */
    display: grid; grid-template-columns: 120px minmax(0, 1fr);
    margin: 10px 14px 0;
    border: 0.5px solid var(--border); border-radius: 6px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
  }
  .tlw-labels {
    padding-top: 18px;                            /* ルーラーの高さぶん下げてトラック行と揃える */
    border-right: 0.5px solid var(--border);
    background: var(--surface-2);
  }
  .tlw-label {                                    /* ★行高40に合わせて縦積み(§180): 名前と件数が読める */
    display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px;
    padding: 0 8px; box-sizing: border-box;
    font-size: 11px; color: var(--text-subtle); white-space: nowrap; overflow: hidden;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);   /* ★トラック行の境界と揃える=対応が分かる */
  }
  .tlw-label b { font-weight: 600; color: var(--text-muted); }
  .tlw-label i { font-style: normal; opacity: 0.75; }
  .tlw-scroll { overflow-x: auto; overflow-y: hidden; }
  .tlw-canvas { position: relative; min-width: 100%; }
  .tlw-ruler {                                    /* ルーラー=上に固定(縦スクロールしても消えない) */
    position: sticky; top: 0; z-index: 2;
    height: 18px;
    border-bottom: 0.5px solid var(--border);
    background: var(--surface-2);
    font-size: 9px; color: var(--text-subtle);
  }
  .tlw-ruler { cursor: ew-resize; touch-action: none; }        /* ★ドラッグでスクラブできる(§180) */
  .tlw-ruler.is-scrubbing { background: var(--line-1); }
  .tlw-ruler .tl-tick {
    position: absolute; top: 3px;
    padding-left: 3px;
    border-left: 1px solid var(--border-strong);
    white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  .tlw-lane {                                     /* 1トラック=固定行高 */
    position: relative; box-sizing: border-box;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
  }
  .tl-clip {                                      /* クリップ=箱(境界線・角丸・最小幅・幅が足りればラベル) */
    position: absolute; top: 3px; bottom: 3px;
    min-width: 2px;
    box-sizing: border-box;
    border: 0.5px solid rgba(0, 0, 0, 0.45);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
  }
  .tl-clip i {
    display: block; padding: 0 5px;
    font-style: normal; font-size: 11px; line-height: 32px;   /* ★行高40に合わせる(§180) */
    color: rgba(0, 0, 0, 0.82); white-space: nowrap;
  }
  .tl-clip:hover { outline: 1px solid var(--accent); }
  .tlw-grid {                                     /* ★縦グリッド線(§180): ルーラーの目盛りをトラックへ落とす */
    position: absolute; left: 0; top: 0; right: 0;
    pointer-events: none; z-index: 0;
  }
  .tlw-grid span {
    position: absolute; top: 0; bottom: 0; width: 0;
    border-left: 0.5px solid rgba(255, 255, 255, 0.055);
  }
  .tlw-tracks { position: relative; }             /* グリッドの基準 */
  .tl-seg-keep { background: var(--video); }              /* 残る映像 */
  .tl-seg-cap  { background: var(--caption); }            /* 字幕 */
  .tl-seg-cap.is-deleted { background: var(--line-1); opacity: 0.5; }
  .tl-seg-fil  { background: var(--line-2); opacity: 0.9; }   /* ★フィラー除去=薄いグレー(詰めた場所・城野指定) */
  .tl-seg-ac   { background: rgba(var(--accent-rgb), 0.45); }   /* AI構成案=中(薄) */
  .tl-seg-ac.is-hi { background: rgba(var(--accent-rgb), 0.95); }  /* 高=濃 */
  .tlw-playhead {                                 /* 再生ヘッド=1要素をtransformで動かす(毎tick再描画しない) */
    position: absolute; top: 0; left: 0;
    width: 2px; background: var(--accent);
    pointer-events: none; z-index: 3;
    will-change: transform;
  }
  .timeline-workspace .script-operation-status { margin: 6px 14px 10px; font-size: 11px; }
  .tl-key {                                       /* 凡例の色チップ */
    display: inline-block; width: 10px; height: 10px;
    margin: 0 4px 0 10px; border-radius: 2px; vertical-align: -1px;
  }
  .tl-key-keep { background: var(--video); }
  .tl-key-cut  { background: var(--surface-3); border: 0.5px solid var(--border-strong); }
  .tl-key-cap  { background: var(--caption); }
  .tl-key-fil  { background: var(--line-2); }
  .tl-key-ac   { background: rgba(var(--accent-rgb), 0.95); }
}
@media (max-width: 640px) {
  .timeline-entry,
  .timeline-workspace { display: none !important; }   /* ★スマホ=完全非表示(3重担保) */

  /* ★【C】スマホのカード形式(城野GO 2026-07-31)。★PCは1pxも変えない=このMQ内だけで見た目を変える
     (DOMは data-ac-pos 属性が増えるだけ)。削る提案=1件1カード/無音・フィラーの数百件はまとめて1枚。 */
  .compose-cand {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    position: relative;
    margin: 0 0 8px;
    padding: 12px 12px 10px;
    border: 0.5px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  }
  .compose-cand > input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; }   /* 指で押せる大きさ */
  /* 1列のgrid。★PC側の列指定(grid-column:1〜3)をリセットしないと暗黙の列ができて横に伸びる。 */
  .compose-cand > span { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
  .compose-cand .pf-jump,
  .compose-cand .ac-conf,
  .compose-cand em,
  .compose-cand small { grid-column: 1; }
  .compose-cand .pf-jump,
  .compose-cand .ac-conf { justify-self: start; }
  .compose-cand .pf-jump { min-width: 0; }               /* カードでは固定幅不要(縦積み) */
  .compose-cand em, .compose-cand small { min-width: 0; overflow-wrap: anywhere; }
  .compose-cand em {                                   /* 対象テキスト=カードの主役 */
    font-style: normal; font-size: 13px; line-height: 1.55; color: var(--text-1);
  }
  .compose-cand small { display: block; margin-top: 0; font-size: 11px; line-height: 1.5; color: var(--text-muted); }
  .compose-cand .pf-jump {                             /* 「その場面を見る」=タップしやすいボタンに */
    display: inline-block; padding: 6px 12px; border-radius: 999px;
    border: 0.5px solid var(--border-strong); background: var(--surface-4);
    font-size: 12px; line-height: 1.4;
  }
  .compose-cand .ac-conf { font-size: 10px; padding: 1px 7px; }
  .compose-cand::after {                               /* ★何枚中何枚目(data-ac-pos=表示中の通し番号) */
    content: attr(data-ac-pos);
    grid-column: 1; grid-row: 2;                       /* チェックボックスの真下=右端の見切れに影響されない */
    justify-self: center; margin-top: 4px;
    font-size: 9px; line-height: 1.2; white-space: nowrap;
    color: var(--text-faint); font-variant-numeric: tabular-nums;
  }
  .compose-group { margin-bottom: 14px; }
  .compose-group-head { position: sticky; top: 0; z-index: 2; padding: 6px 2px; background: var(--surface-1); }

  /* ★無音・フィラー(数百件)は個別カードにしない=まとめて1枚(要約+スクロールする詳細) */
  [data-cuts-filler-list] {
    max-height: 168px; overflow-y: auto;
    padding: 8px; border: 0.5px solid var(--border); border-radius: 10px;
    background: var(--surface-2);
  }
}

/* ★第2段(城野GO 2026-07-30): auto-compose 確信度バッジ+表示閾値トグル。高=確信/中=判断が割れうる。 */
.ac-conf {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 5px;
  margin-right: 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  vertical-align: middle;
}
.ac-conf-hi {
  color: #fff;
  background: var(--caption);   /* 高=確信=はっきり(緑系トークン) */
}
.ac-conf-mid {
  color: var(--text-muted);
  background: transparent;
  border: 0.5px solid var(--border-strong);   /* 中=控えめ=輪郭のみ */
}
.compose-threshold {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.compose-threshold label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.compose-segments {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.compose-segments button {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  text-align: left;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.045);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 7px;
}

.compose-segments em,
.compose-correction em,
.compose-replace-hits em {
  color: var(--text-subtle);
  font-style: normal;
}

.compose-link-button {
  margin-top: 8px;
  color: #ffb347;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 10px;
}

.compose-correction {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.compose-correction strong,
.compose-correction em,
.compose-correction b {
  display: block;
  font-size: 10px;
  line-height: 1.45;
}

.compose-correction b {
  color: #ffd08a;
}

.compose-replace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
/* 一括置換の保存: プレビュー(自動チェックリスト)の下に押しやすい通常ボタン(AI校正と操作感統一) */
.t-replace-save {
  width: 100%; margin-top: 8px; padding: 9px 14px; border: 0; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--accent-foreground); background: var(--accent);
}
.t-replace-save:hover { background: var(--accent-2); }
.t-replace-save[hidden] { display: none; }

.compose-replace input,
.compose-edit-box textarea {
  background: rgba(0, 0, 0, 0.24);
  border: 0.5px solid var(--border);
  color: var(--foreground);
  border-radius: 6px;
  padding: 8px;
}

.compose-dropped {
  margin-top: 12px;
  color: var(--text-subtle);
}

.compose-edit-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.compose-edit-box[hidden],
.compose-result[hidden] {
  display: none;
}

.compose-edit-box textarea {
  min-height: 74px;
  resize: vertical;
}

.compose-result video {
  display: block;
  width: min(100%, 420px);
  margin-top: 10px;
  border-radius: 8px;
  background: #000;
}

.compose-result a {
  display: inline-flex;
  margin-top: 10px;
  color: #ffb347;
}

.compose-result .is-pass {
  color: #70e000;
}

.compose-result .is-fail {
  color: #ff6b6b;
}

.compose-empty {
  color: var(--text-subtle);
  font-size: 10px;
  padding: 8px;
}

@media (max-width: 960px) {
  .app-shell {
    width: 100%;
    height: 100vh;
    height: 100dvh;   /* iOS: アドレスバー対策 */
    margin: 0;
    border-radius: 0;
  }

  .workspace {
    grid-template-columns: 190px minmax(360px, 1fr) 254px;
  }

  .desktop-menu {
    display: none;
  }

  .credit-chip {
    min-width: 118px;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .project-choice-grid,
  .script-type-grid,
  .script-form,
  .script-stage-draft.is-active,
  .compose-grid,
  .compose-replace {
    grid-template-columns: 1fr;
  }

  .script-header {
    grid-template-columns: 1fr auto;
  }

  .script-steps {
    grid-column: 1 / -1;
    overflow: auto;
  }
}


/* ── 翻訳: 言語ピル+言語選択ポップ(城野裁定 2026-07-10) ── */
.lang-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.lang-pill {
  padding: 5px 12px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-subtle);
  font-size: 12px;
  cursor: pointer;
}

.lang-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lang-pick-dialog {
  position: fixed;
  inset: 0;
  z-index: 95;   /* ★クラウド全画面ワークスペース(z-index:60)より上に(plan-dialog=90と同じ教訓。40だと背面で見えない実バグ) */
  display: grid;
  place-items: center;
}

.lang-pick-panel {
  position: relative;
  width: min(360px, calc(100vw - 32px));
  padding: 16px;
  border: 0.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--background);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 10px;
}

.lang-pick-title { font-weight: 700; }

.lang-pick-buttons { display: grid; gap: 8px; }

.lang-pick-btn {
  padding: 10px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--foreground);
  font-size: 14px;
  cursor: pointer;
}

.lang-pick-all { background: var(--accent); border-color: var(--accent); color: #fff; }

.lang-pick-cancel {
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
}


/* ── 詳細設定の視認性(城野裁定 2026-07-11 案1: ボタン風カード) ── */
.detail-settings-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.detail-settings-summary::-webkit-details-marker { display: none; }

.detail-settings-summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-subtle);
}

.detail-settings-summary svg { color: var(--accent); flex: none; }


/* ── メール送信完了カード(城野裁定 2026-07-12: 誰でも分かる大きさ+迷惑メール案内) ── */
.auth-email-sent {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px 14px;
  border: 0.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
}

.auth-email-sent svg { color: var(--accent); }

.auth-sent-title { font-size: 17px; font-weight: 800; color: var(--foreground); }

.auth-sent-to { font-size: 14px; font-weight: 700; color: var(--accent); word-break: break-all; }

.auth-sent-body { font-size: 13px; color: var(--foreground); }

.auth-sent-spam { font-size: 12px; color: var(--text-subtle); }

.auth-sent-again {
  margin-top: 6px;
  padding: 8px 14px;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-subtle);
  font-size: 12.5px;
  cursor: pointer;
}

.auth-message.is-error { color: #d3382f; font-size: 13px; font-weight: 700; }


/* ── ヘルプ2タブ(城野裁定 2026-07-12: ヘッダー常時ボタン+タブ式モーダル) ── */
.cloud-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, background 0.15s;
}

/* 使い方=主役: ブランドアクセントの塗り(最初に見てほしい入口) */
.cloud-help-guide {
  border: 0.5px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.cloud-help-guide:hover { filter: brightness(1.12); }
.cloud-help-guide:active { filter: brightness(0.92); }

/* FAQ=同系のセカンダリ: アクセントの淡い塗り+アクセント文字(役割を区別しつつ世界観は同一) */
.cloud-help-faq {
  border: 0.5px solid rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.cloud-help-faq:hover { background: rgba(var(--accent-rgb), 0.2); }
.cloud-help-faq:active { background: rgba(var(--accent-rgb), 0.28); }

.help-dialog {
  position: fixed;
  inset: 0;
  z-index: 95;   /* クラウドworkspace(60)より上(plan-dialog=90と同じ教訓) */
  display: grid;
  place-items: center;
}

.help-panel {
  position: relative;
  width: min(680px, calc(100vw - 24px));
  max-height: min(84vh, 84dvh);
  display: flex;
  flex-direction: column;
  border: 0.5px solid var(--border-strong);
  border-radius: 14px;
  background: var(--background);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.help-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 0.5px solid var(--border);
  flex: none;
}

.help-tab {
  padding: 8px 12px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-subtle);
  font-size: 12.5px;
  cursor: pointer;
}

.help-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.help-x {
  margin-left: auto;
  min-width: 32px;
  min-height: 30px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
}

.help-body {
  padding: 14px 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--foreground);
}

.help-body h3 { font-size: 15px; margin: 14px 0 6px; }
.help-body h4 { font-size: 13.5px; margin: 14px 0 4px; color: var(--accent); }
.help-body p { margin: 4px 0 8px; }
.help-body ol { margin: 4px 0 8px; padding-left: 22px; }
.help-body li { margin: 2px 0; }
.help-note { color: var(--text-subtle); }

@media (max-width: 640px) {
  /* スマホ: テキストラベルのままコンパクト化(城野裁定: アイコン不要)。塗り=押せる/目立つは維持 */
  .cloud-help-btn { padding: 6px 9px; font-size: 11px; }
  .help-panel { width: calc(100vw - 12px); max-height: 90dvh; }
}

.plan-legal-link, .transcribe-legal-note { text-align: center; font-size: 11.5px; margin-top: 8px; }
.plan-portal-message {
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
}
.plan-legal-link a, .transcribe-legal-note a { color: var(--text-subtle); text-decoration: underline; }

/* フィラー文字の表示層消し(城野GO 2026-07-18): 一覧では消える部分に取り消し線+薄色(編集の種は原文のまま) */
.t-filler-strike { text-decoration: line-through; opacity: 0.45; }

/* ★スマホのピル吹き出しはみ出し修正(城野スマホ実機報告 2026-07-18):
   .tool-pop はピル(details)基準の absolute + left:0 + 最大92vw のため、ツールバー右寄りのピル
   (✂無音カット・フィラー除去等)では吹き出しが画面右外へ伸びてボタンが切れる。
   スマホではアンカーをツールバー全幅へ切替(PCは従来どおり=このメディアクエリ外は不変)。 */
@media (max-width: 640px) {
  .transcribe-toolbar-top { position: relative; }
  .transcribe-toolbar-top > details { position: static; }
  /* ★見た目は従来のポップ(ピルの下・全幅)のまま、スクロールだけ直す(城野裁定 2026-07-19:
     ボトムシートはUX悪化・「スワイプが綺麗にできるだけで良い」)。
     従来の「効いたり効かなかったり」の犯人=ポップ内スクロールにiOS慣性(-webkit-overflow-scrolling)と
     連鎖防止(overscroll-behavior)が無かったこと(字幕リストには両方あり=同じ流儀を移植)。 */
  .transcribe-toolbar-top > details[open] > .tool-pop {
    left: 0;
    right: 0;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    max-height: 70dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* フィラー一覧をチップ状に横並び折返し(城野 2026-07-18: 1件1行で吹き出しが縦に伸びすぎ→圧縮) */
[data-cuts-filler-list] { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
[data-cuts-filler-list] > div { flex: 1 1 100%; }
[data-cuts-filler-list] .compose-undo-link { display: inline; white-space: nowrap; }

/* ★無音カット系の完了カード(城野点検依頼 2026-07-18): 流用元burn-done-cardはPCで折返しなしの1行flex。
   こちらは子要素が多い(実物動画+ボタン最大5+注記)ためPCではみ出す→常に折返し+全幅要素を明示。
   属性セレクタでうちの2箇所のみ対象=既存の焼き付け完了カードには触れない。 */
[data-cuts-download-row], [data-sst-download-row] { flex-wrap: wrap; }
[data-cuts-result-video], [data-sst-result-video], [data-sst-transcribe-note] { flex: 1 1 100%; }

/* 「カット前に戻す」: リンク風だと埋もれる(城野実機 2026-07-19)→視認できる控えめボタンに */
.cuts-revert-btn {
  width: 100%;
  padding: 10px;
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}


/* ═══ ✂ピルPC専用2カラム(城野GO 2026-07-23設計・A案=ラベルmarkup不変) ═══
   ★スマホ≤640pxは1px不変の3重担保: (1)新規則はmin-width:641px限定 (2)ラッパーはスマホで
   display:contents=レイアウト計算から消滅 (3)工程見出し/ヒントはスマホdisplay:none。
   video移設はapp.jsのmatchMedia(PC時のみ)=スマホDOM不変。 */
@media (min-width: 641px) {
  .transcribe-toolbar-top > details[data-scut-cut-panel][open] > .tool-pop {
    /* 位置(left)はapp.jsがビューポート内へクランプ(ピル基準のright:0だと左へ画面外に伸びる=実機で確認) */
    width: min(940px, 92vw);
    max-width: min(940px, 92vw);
  }
  [data-scut-cut-panel] .cuts-pop-cols {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 0 20px;
    align-items: start;
  }
  [data-scut-cut-panel] .cuts-pop-preview { position: sticky; top: 0; }
  .cuts-preview-hint { margin: 0 0 6px; font-size: 12px; color: var(--text-subtle); }
  /* 適用済み(書き出し行が出ている)ときは「適用すると表示されます」の案内を消す */
  .cuts-pop-cols:has([data-cuts-export-row]:not([hidden])) .cuts-preview-hint { display: none; }
  [data-scut-cut-panel] .cuts-pop-preview video {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    background: #000;
    display: block;
  }
  .cuts-step-h {
    margin: 12px 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-subtle);
    letter-spacing: 0.02em;
  }
  .cuts-pop-ops > .cuts-step-h:first-child { margin-top: 0; }
  /* 出力4択: 1行1択の縦カード(折り返し禁止・選択中はアクセント枠) */
  [data-scut-cut-panel] [data-cuts-export-row] .scut-vad-row[role="radiogroup"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  [data-scut-cut-panel] [data-cuts-export-row] .scut-vad-row[role="radiogroup"] label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
  }
  [data-scut-cut-panel] [data-cuts-export-row] .scut-vad-row[role="radiogroup"] label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.10);
  }
  /* 工程順(PCのみ): …書き出す→保存カード→③見出し→字幕編集へ。flex column+order(スマホはMQ外=DOM順) */
  [data-scut-cut-panel] [data-cuts-export-row] {
    flex-direction: column;
    align-items: stretch;
  }
  [data-scut-cut-panel] [data-cuts-download-row] { order: 1; }
  [data-scut-cut-panel] .cuts-step-h[data-step3] { order: 2; }
  [data-scut-cut-panel] [data-cuts-save-project] { order: 3; }
}
@media (max-width: 640px) {
  /* ★スマホ不変担保: 新ラッパーを消し、新テキスト要素を出さない(既存要素には一切触れない) */
  .cuts-pop-cols, .cuts-pop-ops, .cuts-pop-preview { display: contents; }
  .cuts-step-h, .cuts-preview-hint { display: none; }
}

/* ✂ピル右カラム: 字幕重ねプレビュー+「字幕を編集する」(城野指示 2026-07-24・PC専用。
   スマホ≤640pxは新要素を全て非表示=退行ゼロの流儀) */
@media (min-width: 641px) {
  [data-scut-cut-panel] .cuts-preview-wrap { position: relative; }
  .cuts-overlay-toggle { margin-top: 8px; }
  [data-scut-cut-panel] [data-cuts-edit-subs] { margin-top: 8px; width: 100%; }
  .cuts-pop-cols:not(:has([data-cuts-export-row]:not([hidden]))) .cuts-preview-wrap,
  .cuts-pop-cols:not(:has([data-cuts-export-row]:not([hidden]))) .cuts-overlay-toggle,
  .cuts-pop-cols:not(:has([data-cuts-export-row]:not([hidden]))) [data-cuts-edit-subs] { display: none; }
}
@media (max-width: 640px) {
  .cuts-preview-wrap, .cuts-overlay-toggle, [data-cuts-edit-subs] { display: none; }
}

/* 派生プロジェクト出口「カット+字幕(編集ソフト用)」メニュー(城野GO 2026-07-24)。
   cut_exportスナップショットがある時だけJSがhiddenを外す=通常/旧派生プロジェクトでは不可視 */
.cut-export-menu { position: relative; flex: 0 0 auto; min-width: 0; }
.cut-export-menu > summary {
  list-style: none;
  display: block;
  text-align: center;
  padding: 9px 10px;
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.cut-export-menu > summary::-webkit-details-marker { display: none; }
.cut-export-menu > summary::marker { content: ""; }
.cutexp-pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: grid;
  gap: 6px;
  min-width: 264px;
  padding: 8px;
  border: 0.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-2, #fff);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.cutexp-pop button { width: 100%; padding: 11px 10px; font-size: 12px; white-space: normal; }

/* 統合メニュー冒頭の説明1行(無劣化の集約先・城野裁定 2026-07-24) */
.cutexp-note { margin: 0 0 2px; font-size: 11px; color: var(--text-subtle); line-height: 1.6; white-space: normal; }

/* ═══ ワンクリックおまかせ編集(城野GO 2026-07-24・A案) ═══ */
.omakase-hero-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto 14px;
  padding: 22px 24px;
  text-align: left;
  border: 1.5px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.05));
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.12);
}
.omakase-hero-card:hover { border-color: var(--accent); }
.omakase-hero-badge { font-size: 11px; font-weight: 800; color: var(--accent); letter-spacing: 0.04em; }
.omakase-hero-card strong { font-size: 19px; font-weight: 800; }
.omakase-hero-sub { font-size: 13px; color: var(--muted-strong, var(--text)); line-height: 1.7; }
.omakase-hero-note { font-size: 11.5px; color: var(--text-subtle); }
.omakase-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 12, 16, 0.66);
}
.omakase-overlay[hidden] { display: none; }
.omakase-card {
  width: min(560px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 22px 22px 18px;
  border: 0.5px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-1);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}
.omakase-card h3 { margin: 0 0 10px; font-size: 17px; font-weight: 800; }
.omakase-video-name { margin: 0 0 4px; font-size: 12.5px; color: var(--text-subtle); word-break: break-all; }
.omakase-cost { margin: 0 0 8px; font-size: 14px; font-weight: 700; line-height: 1.7; }
/* おまかせ確認画面の警告(尺取得失敗/分数不足)を枠・色で示す(⚠絵文字の代替・城野裁定 2026-07-24) */
.omakase-cost.is-warn {
  padding: 8px 10px;
  border: 0.5px solid rgba(255, 79, 79, 0.45);
  border-radius: 6px;
  background: rgba(255, 79, 79, 0.1);
  color: #ffb3b3;
  white-space: pre-line;
}
.omakase-note { margin: 8px 0 0; font-size: 12px; color: var(--text-subtle); line-height: 1.7; }
/* 低解像度案内(城野 2026-07-25: 「ビデオを撮る」低画質の注意)。赤(エラー)ではなく黄系の注意 */
.omakase-lowres { margin: 8px 0 0; padding: 8px 10px; font-size: 12px; line-height: 1.7;
  border: 0.5px solid rgba(240, 180, 0, 0.5); background: rgba(240, 180, 0, 0.1); color: #e0a800; border-radius: 8px; }
.omakase-lowres[hidden] { display: none; }
.omakase-subnote { margin: 10px 0 0; font-size: 11.5px; color: var(--text-subtle); line-height: 1.7; }
.omakase-error { margin: 0; font-size: 13px; line-height: 1.7; }
.omakase-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.omakase-actions .silence-cut-button { flex: 1 1 auto; }
.omakase-ghost {
  flex: 0 1 auto;
  padding: 10px 14px;
  border: 0.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.omakase-steps { margin: 0; padding: 0 0 0 2px; list-style: none; display: grid; gap: 10px; }
.omakase-steps li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 0.5px solid var(--border);
  border-radius: 10px;
  opacity: 0.55;
}
.omakase-steps li b { font-size: 13px; }
.omakase-steps li span { font-size: 11.5px; color: var(--text-subtle); min-height: 1em; line-height: 1.6; }
.omakase-steps li.is-active {
  opacity: 1;
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.08);
}
/* ★処理中の段に点滅ドット(城野 2026-07-25: 焼き付け中に動きが欲しい)。is-doneでは止める */
.omakase-steps li.is-active:not(.is-done) b::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
  animation: omakase-pulse 1s ease-in-out infinite;
}
@keyframes omakase-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.7); } }
.omakase-steps li.is-done { opacity: 0.9; }
.omakase-steps li.is-done b::after { content: " ✓"; color: var(--accent); }
[data-omakase-video] { width: 100%; max-height: 46dvh; border-radius: 10px; background: #000; display: block; }

/* ★字幕タイミング不確か(§102/§103・外国語微弱音声等でTSがずれる区間・自動補正の対象外) */
.transcribe-row.is-timing-uncertain { background: rgba(255, 176, 32, 0.08); }
.t-timing-warn { color: #e08a00; cursor: help; margin: 0 2px; font-size: 0.9em; }

/* ★ショート切り抜き 第1段(城野GO 2026-08-01・§159/§160)。候補カード=サムネ+見出し+判定バッジ+理由。
   ★既存セレクタに一切触れない新規クラスのみ(退行ゼロの担保)。スマホでも縦積みで読める作りにする。 */
.shorts-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px;
  margin: 6px 0;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
}
.shorts-card:hover { border-color: var(--accent); }
.shorts-card.is-rejected { opacity: 0.85; grid-template-columns: minmax(0, 1fr); }
.shorts-thumb {                                  /* 動画から抜いた1フレーム(背景画像として当てる) */
  width: 96px; height: 54px;
  border-radius: 5px;
  background: var(--surface-3) center/cover no-repeat;
  flex: 0 0 auto;
}
.shorts-thumb.is-ready { background-color: transparent; }
.shorts-body { min-width: 0; }
.shorts-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.shorts-head b { font-weight: 600; }
.shorts-badge {
  font-size: 10px; line-height: 1.6;
  padding: 0 6px; border-radius: 999px;
  border: 0.5px solid var(--border-strong); color: var(--text-subtle);
  white-space: nowrap;
}
.shorts-badge.is-hi { background: rgba(var(--accent-rgb), 0.9); border-color: transparent; color: #fff; }
.shorts-badge.is-mid { background: rgba(var(--accent-rgb), 0.35); border-color: transparent; }
.shorts-badge.is-rej { background: var(--line-2); border-color: transparent; }
.shorts-flag { font-size: 10px; padding: 0 6px; border-radius: 999px; background: var(--line-1); color: var(--text-subtle); }
.shorts-meta { font-size: 11px; color: var(--text-subtle); font-variant-numeric: tabular-nums; margin-top: 2px; }
.shorts-why { font-size: 12px; line-height: 1.5; margin-top: 3px; }
.shorts-rejected { margin-top: 8px; }
.shorts-rejected > summary { font-size: 12px; color: var(--text-subtle); cursor: pointer; }
/* ★バッジを保証に見せない凡例(§170)。控えめに=候補そのものより目立たせない */
.shorts-legend { font-size: 11px; color: var(--text-subtle); margin: 2px 0 6px; }
/* ★ショート第2段=切り出しボタン(§178)。カード内の操作＝カードのクリック(シーク)と見分けが付くように */
.shorts-actions { margin-top: 6px; }
.shorts-dl {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--accent); background: transparent; color: var(--accent);
}

/* ★§261 切り出しの微調整UI */
.shorts-adjust {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 12px; color: var(--muted, #888); margin-top: 6px;
}
.shorts-adj-btn {
  font-size: 12px; padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--border, #444); background: transparent; color: inherit; cursor: pointer;
}
.shorts-adj-btn:active { transform: scale(0.96); }
.shorts-dl:hover:not(:disabled) { background: rgba(var(--accent-rgb), 0.12); }
.shorts-dl:disabled { opacity: 0.6; cursor: progress; }

/* ★カスタム辞書パネル(§176)。1行入力の【下】に足す表示層＝既存の入力欄は消していない */
.dict-panel { grid-column: 1 / -1; margin: -2px 0 6px; display: grid; gap: 6px; }
.dict-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dict-tools .dict-input { flex: 1 1 160px; min-width: 0; }
.dict-count { font-size: 11px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.dict-count[data-full="1"] { color: var(--accent); font-weight: 600; }   /* 上限に達したら気づける */
.dict-chips { display: flex; flex-wrap: wrap; gap: 4px; max-height: 132px; overflow-y: auto; }
.dict-chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px;
  padding: 2px 4px 2px 8px; border-radius: 999px; background: var(--line-1); color: var(--text);
}
.dict-chip button {
  border: 0; background: transparent; color: var(--text-subtle); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0 3px; border-radius: 999px;
}
.dict-chip button:hover { background: var(--line-2); color: var(--text); }
.dict-empty { font-size: 11px; color: var(--text-subtle); }
.dict-io { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dict-io button { font-size: 12px; }
.dict-note { font-size: 11px; color: var(--text-subtle); }
@media (max-width: 640px) {
  .shorts-card { grid-template-columns: minmax(0, 1fr); }   /* スマホは縦積み(サムネは上) */
  .shorts-thumb { width: 100%; height: 96px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ★入口の作り直し（§192・2026-08-04・城野裁定「モック_入口_1440.png が良い」）
   参考=CapCut のホーム。骨は3つ:
     ①左レール（できることが常に見える） ②中央に大きな箱1つ ③下に「続きから」
   ★色は全てテーマトークン経由＝皮を替えても壊れない（アクセントは青1色）。
   ★枠線は最小限・階層は「面の明るさ」と「余白/文字ウェイト」で作る（城野のダーク5原則）。
   ══════════════════════════════════════════════════════════════════════════ */
/* ★親(.transcribe-top)は place-items:center のグリッド＝中身が max-content 幅に潰れる。
   新レイアウトは全幅で使うので、この段だけ stretch に上書きする(旧レイアウトには触らない)。 */
.transcribe-top:has(.ktop) { padding: 0; max-width: none; place-items: stretch; min-height: 0; }
.ktop {
  display: flex; align-items: stretch; text-align: left;
  width: 100%; grid-column: 1 / -1; justify-self: stretch;
  min-height: calc(100vh - 64px);
}

/* ── ①左レール ── */
.ktop-rail {
  width: 248px; flex: 0 0 248px; background: var(--surface-2);
  display: flex; flex-direction: column; padding: 20px 12px 0;
}
.ktop-new {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border: 0; border-radius: 10px; cursor: pointer; width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14.5px; font-weight: 700; font-family: inherit;
  box-shadow: 0 2px 12px rgba(var(--accent-rgb), 0.28); margin-bottom: 16px;
}
.ktop-new:hover { filter: brightness(1.08); }
.ktop-new svg { width: 17px; height: 17px; }
.ktop-navgroup { margin-bottom: 6px; }
.ktop-navlabel {
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  letter-spacing: 0.06em; padding: 14px 10px 6px;
}
.ktop-nav {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: 13.5px;
  border: 0; background: none; font-family: inherit; width: 100%; text-align: left;
}
.ktop-nav:hover { background: var(--muted-2); color: var(--foreground); }
.ktop-nav.is-on { background: rgba(var(--accent-rgb), 0.14); color: var(--accent); font-weight: 600; }
.ktop-nav svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.9; }
.ktop-railfoot { margin-top: auto; padding: 14px 4px 16px; }
.ktop-credit { background: var(--muted-2); border-radius: 10px; padding: 12px 13px; }
.ktop-credit-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ktop-credit-k { font-size: 11.5px; color: var(--text-subtle); }
.ktop-credit-v { font-size: 15px; font-weight: 700; color: var(--foreground); }
.ktop-bar { height: 4px; border-radius: 2px; background: var(--muted-3); overflow: hidden; }
.ktop-bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

/* ── ②中央 ── */
.ktop-main { flex: 1; min-width: 0; padding: 28px 48px 56px; }
.ktop-hero { max-width: 760px; margin: 0 auto; text-align: center; }
.ktop-h1 { font-size: 34px; line-height: 1.35; font-weight: 700; letter-spacing: 0.01em; margin: 0 0 10px; }
.ktop-lead { font-size: 14.5px; color: var(--text-subtle); margin: 0 0 26px; }
.ktop-modes {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--muted-2); border-radius: 11px; margin-bottom: 20px;
}
.ktop-mode {
  display: flex; align-items: center; gap: 7px; padding: 8px 17px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-muted); cursor: pointer;
  border: 0; background: none; font-family: inherit;
}
.ktop-mode:hover { color: var(--foreground); }
.ktop-mode.is-on {
  background: var(--surface-8); color: var(--foreground); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.ktop-mode svg { width: 16px; height: 16px; }

/* ★大きな箱1つ */
.ktop-drop {
  background: var(--surface-6); border-radius: 16px;
  border: 1.5px dashed rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.36);
  overflow: hidden; transition: border-color 0.15s, background 0.15s; text-align: center;
}
.ktop-drop:hover, .ktop-drop:focus-visible { border-color: rgba(var(--accent-rgb), 0.62); background: var(--surface-8); }
.ktop-drop.is-dragover { border-color: var(--accent); background: var(--surface-8); }
.ktop-dropbody { padding: 52px 32px 44px; cursor: pointer; }
.ktop-dropicon {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.13); display: grid; place-items: center;
}
.ktop-dropicon svg { width: 28px; height: 28px; stroke: var(--accent); }
.ktop-droptitle { display: block; font-size: 20px; font-weight: 700; margin-bottom: 7px; }
.ktop-dropsub { display: block; font-size: 13.5px; color: var(--text-subtle); }
.ktop-dropfmt { display: block; font-size: 11.5px; color: var(--text-faint); margin-top: 12px; }
.ktop-dropbar {
  display: flex; align-items: center; gap: 9px; padding: 12px 14px;
  background: var(--surface-5); border-top: 1px solid var(--border); text-align: left;
}
.ktop-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: 8px; background: var(--muted-2); color: var(--text-muted);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
  border: 0; font-family: inherit;
}
.ktop-chip:hover { background: var(--muted-3); color: var(--foreground); }
.ktop-chip svg { width: 15px; height: 15px; }
.ktop-spacer { flex: 1; }
.ktop-hidden-hook { display: none !important; }   /* 既存ハンドラの受け皿(見せない・押さない) */
.ktop-start {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 22px;
  border: 0; border-radius: 9px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px; font-weight: 700; font-family: inherit;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.3);
  white-space: nowrap; flex: 0 0 auto;
}
.ktop-start:hover { filter: brightness(1.08); }
.ktop-demo {
  display: inline-flex; align-items: center; gap: 9px; margin: 18px auto 0;
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border);
  background: none; color: var(--text-muted); cursor: pointer;
  font-family: inherit; text-align: left; max-width: none; width: auto;
}
.ktop-demo:hover { background: var(--muted-2); color: var(--foreground); }
.ktop-demo .transcribe-demo-text { display: flex; flex-direction: column; }
.ktop-demo .transcribe-demo-text strong { font-size: 13px; font-weight: 600; }
.ktop-demo .transcribe-demo-text span { font-size: 11.5px; color: var(--text-faint); }

/* ── ③続きから ── */
.ktop-sec { max-width: 1040px; margin: 48px auto 0; text-align: left; }
.ktop-sechead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.ktop-sechead h3 { font-size: 15.5px; font-weight: 700; margin: 0; }
.ktop-seclink { font-size: 12.5px; color: var(--text-subtle); cursor: pointer; border: 0; background: none; font-family: inherit; }
.ktop-seclink:hover { color: var(--accent); }
.ktop-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  background: none; border: 0; padding: 0; max-height: none; overflow: visible;
  max-width: none; margin: 0;   /* ★旧 .transcribe-history-list の 620px/auto中央寄せを打ち消す */
}
.ktop-cards .history-row {
  position: relative; display: block; background: var(--surface-6);
  border-radius: 11px; overflow: hidden; border: 0; padding: 0;
}
.ktop-cards .history-row:hover { background: var(--surface-8); }
.ktop-cards .history-open {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: pointer; font-family: inherit; text-align: left; color: inherit;
}
.ktop-thumb {
  display: block; aspect-ratio: 16 / 9; background: var(--muted-3) center / cover no-repeat;
  position: relative;
}
.ktop-cards .history-open strong {
  display: block; font-size: 13px; font-weight: 600; padding: 10px 12px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ktop-cards .history-open span { display: block; font-size: 11.5px; color: var(--text-faint); padding: 2px 12px 12px; }
.ktop-cards .history-delete {
  position: absolute; top: 7px; right: 7px; width: 24px; height: 24px;
  border-radius: 6px; border: 0; cursor: pointer; opacity: 0;
  background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 14px; line-height: 1;
}
.ktop-cards .history-row:hover .history-delete { opacity: 1; }
.ktop-cards .history-delete:hover { background: rgba(0, 0, 0, 0.85); }
.ktop-note { text-align: center; margin-top: 34px; }

/* ── 狭い画面 ── */
@media (max-width: 1100px) { .ktop-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .ktop { flex-direction: column; min-height: 0; }
  .ktop-rail { width: auto; flex: none; flex-direction: row; align-items: center;
    gap: 8px; overflow-x: auto; padding: 12px; }
  .ktop-navgroup { margin: 0; display: flex; gap: 6px; }
  .ktop-navlabel { display: none; }
  .ktop-new { width: auto; margin: 0; padding: 0 16px; flex: 0 0 auto; }
  .ktop-nav { white-space: nowrap; width: auto; }
  .ktop-railfoot { margin: 0 0 0 auto; padding: 0; }
  .ktop-main { padding: 20px 16px 40px; }
  .ktop-h1 { font-size: 26px; }
  .ktop-modes { display: flex; overflow-x: auto; }
  .ktop-dropbar { flex-wrap: wrap; }
}
.ktop-credit-unit { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.ktop-caret { opacity: 0.5; font-size: 10px; }

/* ── ★§193 入口に統合したもの（確認ビュー／詳細設定／課金の注記）── */
.ktop-billing {
  max-width: 760px; margin: 14px auto 0; text-align: center;
  font-size: 12px; color: var(--text-subtle);
}
/* 詳細設定は入口の箱の直下。開くまでは1行のバーに見える＝入口を太らせない */
.ktop-hero > .compose-settings {
  max-width: 760px; margin: 14px auto 0; text-align: left;
  background: var(--surface-5); border: 1px solid var(--border); border-radius: 12px;
}
.ktop-hero > .compose-settings > summary {
  list-style: none; cursor: pointer; padding: 12px 16px;
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-muted);
}
.ktop-hero > .compose-settings > summary::-webkit-details-marker { display: none; }
.ktop-hero > .compose-settings > summary:hover { color: var(--foreground); }
.ktop-hero > .compose-settings[open] > summary { border-bottom: 1px solid var(--border); }
.ktop-hero > .compose-settings > .compose-settings-grid { padding: 16px; }

/* 実行前の確認（箱の中身が差し替わる＝画面は動かない） */
.ktop-drop.is-confirm { border-style: solid; border-color: rgba(var(--accent-rgb), 0.55); cursor: default; }
.ktop-confirm { padding: 34px 32px 28px; text-align: center; }
.ktop-confirm-file { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; }
.ktop-confirm-ic {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(var(--accent-rgb), 0.13);
}
.ktop-confirm-ic svg { width: 20px; height: 20px; stroke: var(--accent); }
.ktop-confirm-name {
  font-size: 16px; font-weight: 700; max-width: 480px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ktop-confirm-cost { font-size: 14px; color: var(--text-muted); margin: 0 0 4px; }
.ktop-confirm-warn { font-size: 13px; color: #ffb020; margin: 8px 0 0; }
.ktop-confirm-actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }
.ktop-confirm-cancel {
  height: 38px; padding: 0 18px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-strong); background: none; color: var(--text-muted);
  font-size: 13.5px; font-family: inherit;
}
.ktop-confirm-cancel:hover { background: var(--muted-2); color: var(--foreground); }

/* ★チャンネル・カルテ(?karte・§276): cloud皮は起動時に .script-workspace を
   fixed inset:0 z-index:60 の全画面で開くため、通常フローに置いたパネルはその下に隠れる。
   表示時(=?karteでhidden解除時)のみパネルを最上層の全画面にする。
   ?karteなしは hidden のままセレクタに一致しない=既存画面は無風。 */
[data-karte-panel]:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: clamp(10px, 3vw, 32px);
}
.karte-shell {
  position: relative;
  width: min(920px, 100%);
  max-height: min(88vh, 100%);
  overflow-y: auto;
  background: var(--background);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 26px clamp(16px, 4vw, 36px) 32px;
}
.karte-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.karte-close:hover { color: var(--foreground); background: var(--muted-2); }
.ktop-karte-row { display: flex; justify-content: flex-end; margin: 0 0 6px; }
.ktop-karte-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 70, 70, 0.5);
  border-radius: 999px;
  background: rgba(255, 70, 70, 0.09);
  color: var(--foreground);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ktop-karte-btn svg { width: 18px; height: 18px; }
.ktop-karte-btn:hover { border-color: #ff5252; background: rgba(255, 70, 70, 0.16); }
.karte-head h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: 0.01em; }
.karte-lead { color: var(--text-muted); font-size: 13.5px; margin: 0 0 22px; }
.karte-hero {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 34px 24px 26px;
  text-align: center;
  background: rgba(var(--accent-rgb), 0.05);
}
.karte-note {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.75;
  max-width: 540px;
  margin: 14px auto 0;
}
.karte-status { margin: 16px 0 4px; font-size: 13px; color: var(--text-muted); min-height: 1.2em; }
.karte-status[data-kind="error"] { color: #ff8d9d; }
.karte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 14px 0 0;
}
.karte-card {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.karte-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.karte-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.35); }
.karte-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--muted-2);
}
.karte-card-body { display: block; padding: 10px 12px 12px; }
.karte-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 6px;
  min-height: 2.6em;
}
.karte-card-meta { display: block; color: var(--text-muted); font-size: 11.5px; }
.karte-chart {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 14px;
  margin-top: 22px;
}
.karte-chart h3 { font-size: 14.5px; margin: 0 0 12px; }
.karte-chart svg { width: 100%; height: auto; display: block; }
.karte-axis-note { color: var(--text-muted); font-size: 11.5px; margin: 10px 0 0; }
.karte-note a { color: var(--text-muted); text-decoration: underline; }
.karte-note a:hover { color: var(--accent); }

/* ★お知らせ+豆知識(§285・設計=§273) */
.news-bell { position: relative; }
.news-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5252;
}
.news-panel:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: clamp(10px, 3vw, 32px);
}
.news-shell {
  position: relative;
  width: min(560px, 100%);
  max-height: min(80vh, 100%);
  overflow-y: auto;
  background: var(--background);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 24px 26px 28px;
}
.news-shell h2 { font-size: 18px; margin: 0 0 8px; }
.news-item { border-top: 1px solid var(--border); padding: 14px 0 12px; }
.news-item:first-of-type { border-top: none; }
.news-date { color: var(--text-muted); font-size: 11.5px; }
.news-item h3 { font-size: 14px; margin: 3px 0 6px; }
.news-item p { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin: 0; }
.news-empty { color: var(--text-muted); font-size: 13px; }
.kugina-tip {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;   /* ★「押せない」原則のCSS機械化(§273) */
}
.kugina-tip.is-in { opacity: 1; }

/* ★4象限診断(§325): カルテのレポート1行目。数字でなく「あなたは今どれか」を大きく出す */
.karte-diag {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--text-muted);
  border-radius: 12px;
  background: var(--muted-2);
}
.karte-diag[data-tone="go"] { border-left-color: var(--accent); background: rgba(var(--accent-rgb), 0.07); }
.karte-diag[data-tone="warn"] { border-left-color: #ff8d4d; background: rgba(255, 141, 77, 0.07); }
.karte-diag strong { display: block; font-size: 16px; margin-bottom: 6px; }
.karte-diag p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--text-muted); }

/* ★選ぶ=プロンプト構成(§335) */
.erabu-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  margin-bottom: 8px;
}

/* ══════════ ★自動編集 専用画面②(§426・見本=artifact 46e023a6 のデザインを移植) ══════════ */
.aest-summary{display:flex;align-items:center;gap:16px;background:var(--panel,rgba(255,255,255,.03));
  border:1px solid var(--line,#2a333e);border-radius:10px;padding:12px 16px;margin:8px 0 12px}
.aest-dur{font-variant-numeric:tabular-nums;font-size:18px;font-weight:700}
.aest-dur .aest-after{color:var(--accent)}
.aest-dur small{display:block;font-size:12px;font-weight:400;opacity:.7}
.aest-videos{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.aest-videos video{width:100%;max-height:230px;background:#000;border-radius:8px}
.aest-vlabel{font-size:12px;opacity:.75;margin-bottom:4px;font-weight:600}
@media (max-width:720px){ .aest-videos{grid-template-columns:1fr} }
.aest-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line,#2a333e);margin:6px 0 12px}
.aest-tab{background:none;border:none;color:inherit;opacity:.65;font-size:13.5px;font-weight:600;
  padding:8px 14px 10px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
.aest-tab.is-on{opacity:1;border-bottom-color:var(--accent)}
.aest-script{display:flex;flex-direction:column}
.aest-blk{border:1px solid var(--line,#2a333e);border-radius:10px;padding:12px 16px;margin:0 0 8px;
  background:var(--panel,rgba(255,255,255,.03))}
.aest-bhead{display:flex;gap:12px;align-items:baseline;margin-bottom:4px}
.aest-btime{font-variant-numeric:tabular-nums;font-weight:700;color:var(--accent);font-size:12.5px}
.aest-bsrc{font-variant-numeric:tabular-nums;opacity:.6;font-size:11.5px}
.aest-blk p{margin:4px 0;max-width:66ch;line-height:1.85;font-size:13.5px}
.aest-seam{display:flex;align-items:center;gap:10px;color:#e0a43e;font-size:12.5px;padding:6px 4px;margin:0 0 8px}
.aest-seam::after{content:"";flex:1;border-top:1px dashed rgba(224,164,62,.45)}
.aest-seam button{border:1px solid rgba(224,164,62,.5);background:none;color:#e0a43e;border-radius:6px;
  padding:2px 9px;cursor:pointer;font-size:12px}
.aest-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px}
.aest-chip{border:1px solid var(--line,#2a333e);background:none;color:inherit;border-radius:999px;
  padding:3px 12px;font-size:12.5px;cursor:pointer;display:inline-flex;gap:6px;align-items:center}
.aest-chip.is-on{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.aest-chip .aest-dot{width:8px;height:8px;border-radius:50%}
.aest-tablewrap{overflow-x:auto;border:1px solid var(--line,#2a333e);border-radius:10px}
.aest-table{border-collapse:collapse;width:100%;min-width:760px;font-size:13px}
.aest-table th{position:sticky;top:0;background:var(--panel,#1b232d);opacity:.85;font-size:11px;font-weight:600;
  letter-spacing:.07em;text-align:left;padding:7px 12px;border-bottom:1px solid var(--line,#2a333e);white-space:nowrap}
.aest-table th.aest-r{text-align:right}
.aest-table td{padding:9px 12px;border-bottom:1px solid var(--line,#2a333e);vertical-align:top}
.aest-table tr:last-child td{border-bottom:none}
.aest-t-time{font-variant-numeric:tabular-nums;white-space:nowrap;opacity:.7;width:70px}
.aest-badge{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:5px;color:#10151b;white-space:nowrap}
.aest-b-撮影者{background:#e0a43e}.aest-b-断片{background:#8fa3b8}
.aest-b-言い直し{background:#b48ce8}.aest-b-重複説明{background:#45c9ab}.aest-b-その他{background:#9aa8b6}
.aest-t-q{max-width:340px}
.aest-t-q .aest-q{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
tr.aest-open .aest-q{white-space:normal}
.aest-t-why{max-width:260px;opacity:.7;font-size:12px}
.aest-t-ops{white-space:nowrap;text-align:right;width:150px}
.aest-op{border:1px solid var(--line,#2a333e);background:none;color:inherit;border-radius:7px;
  padding:3px 9px;font-size:12px;cursor:pointer}
.aest-op.aest-play{color:var(--accent);border-color:var(--accent)}
.aest-op+.aest-op{margin-left:6px}
tr.aest-restored td{opacity:.5}
tr.aest-restored .aest-q{text-decoration:line-through}

.aest-actions{display:flex;gap:8px;margin-left:auto;flex-wrap:wrap}
.aest-actions .silence-cut-button{width:auto;padding:6px 14px;font-size:12.5px}
.aest-cuttime{font-variant-numeric:tabular-nums;color:var(--accent);margin-left:10px;font-weight:700}
.aest-vnote{font-size:11px;opacity:.55;margin-top:3px}

/* ★§490 自動編集の進捗(城野 2026-08-14「フリーズして見える」)。
   中身は .omakase-steps / .omakase-note を再利用=見た目は既存と同一。ここは器の余白だけ。 */
.autoedit-progress { margin: 10px 0 2px; }
.autoedit-progress[hidden] { display: none; }
