/* ============================================================
   scripts/web/styles.css — ホテル動画ジェネレータ (本番 UI)
   ------------------------------------------------------------
   共通トークン: ./tokens.css
   共通コンポーネント: ./components.css
   ここでは本アプリ固有のレイアウト・ドメイン UI だけを書く。
   docs/ver1/styles.css をベースに、アップロード/結果モーダル/
   ログ表示など本番に必要な要素を追加している。
   ============================================================ */

:root {
  --top-h: 52px;
  --left-w: 380px;
}

html, body, #root { height: 100%; }
body { overflow: hidden; }

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

.topbar {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 0 var(--space-5);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  height: var(--top-h);
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text);
  letter-spacing: -0.01em;
}
.topbar .brand .logo {
  width: 26px; height: 26px;
  background: var(--accent-2);
  color: white;
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: -0.02em;
}
.topbar .crumbs {
  color: var(--muted);
  font-size: 12px;
}
.topbar .crumbs .sep { margin: 0 8px; color: var(--border-hover); }
.topbar .spacer { flex: 1; }
.topbar .save-state {
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.topbar .save-state .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
}

.workspace {
  display: grid;
  grid-template-columns: var(--left-w) 1fr;
  min-height: 0;
}

/* -------------------- Left pane -------------------- */
.left {
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.left::-webkit-scrollbar { width: 10px; }
.left::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
  border: 2px solid var(--panel);
}

.section { border-bottom: 1px solid var(--border-soft); }
.section-head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}
.section-head .count {
  background: var(--panel-3);
  color: var(--text-2);
  border-radius: var(--radius-pill);
  padding: 0 7px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.section-head .spacer { flex: 1; }
.section-head button.tiny {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.section-head button.tiny:hover { color: var(--accent); background: var(--panel-2); }

.hotel-summary {
  padding: 0 14px 14px;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.hotel-summary .row {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 12px;
}
.hotel-summary textarea {
  min-height: 140px;
  font-size: 12px;
  line-height: 1.55;
}

.settings-grid {
  padding: 4px 14px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) 10px;
}
.setting {
  display: flex; flex-direction: column; gap: 4px;
}
.setting > span {
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.setting select {
  padding: 6px 8px;
  font-size: 12px;
}

/* -------------------- Material upload -------------------- */
.upload-zone {
  margin: 0 14px 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  background: var(--bg-deep);
  font-size: 12px;
  color: var(--muted);
}
.upload-zone:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.upload-zone.dragover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg-strong);
}
.upload-zone .icon {
  font-size: 22px;
  margin-bottom: 4px;
  opacity: 0.7;
}
.upload-zone strong { color: var(--text); }

.file-list {
  padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.file-item {
  display: grid;
  grid-template-columns: 32px 1fr 24px;
  align-items: center;
  gap: var(--space-3);
  padding: 6px 8px;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
}
.file-item .idx {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
}
.file-item .name {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
.file-item .kind {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
  background: var(--panel-3);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  font-weight: 600;
  flex-shrink: 0;
}
.file-item .remove {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}
.file-item .remove:hover {
  background: var(--bad-bg);
  color: var(--bad);
}

/* -------------------- Material thumbnail grid (setup 画面) -------------------- */
.material-grid {
  padding: 0 14px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.material-tile {
  display: flex; flex-direction: column;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.material-tile .thumb {
  aspect-ratio: 9 / 16;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
}
.material-tile .thumb img,
.material-tile .thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.material-tile .thumb .idx-badge {
  position: absolute;
  top: 4px; left: 4px;
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
}
.material-tile .thumb .kind-tag {
  position: absolute;
  top: 4px; right: 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  font-weight: 600;
}
.material-tile .row {
  display: flex; align-items: center;
  gap: 4px;
  padding: 4px 6px;
  font-size: 10.5px;
}
.material-tile .row .name {
  flex: 1; min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.material-tile .row .tiny {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  background: transparent;
  border: none;
  cursor: pointer;
}
.material-tile .row .tiny:hover:not(:disabled) {
  background: var(--panel-3);
  color: var(--text);
}
.material-tile .row .tiny:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.material-tile .row .remove {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  background: transparent;
  border: none;
  cursor: pointer;
}
.material-tile .row .remove:hover {
  background: var(--bad-bg);
  color: var(--bad);
}

/* -------------------- 過去ジョブ一覧 (setup 画面) -------------------- */
.setup-pane {
  display: flex; flex-direction: column;
  gap: 12px;
  padding: 12px 16px 0;
  overflow-y: auto;
}
.past-jobs {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px 12px;
}
.past-jobs .section-head {
  display: flex; align-items: center;
  gap: 8px;
  padding: 0 2px 8px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
}
.past-jobs .section-head .count {
  font-family: var(--mono);
  background: var(--panel-3);
  color: var(--muted-2);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
}
.past-jobs .empty {
  font-size: 12px;
  color: var(--muted-2);
  padding: 12px 4px;
  text-align: center;
}
.past-jobs .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.past-card {
  display: flex; flex-direction: column;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.past-card:hover {
  border-color: var(--accent);
}
.past-card.opening {
  opacity: 0.6;
}
.past-card .thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.past-card .thumb-btn:disabled {
  cursor: wait;
}
.past-card .thumb {
  aspect-ratio: 9 / 16;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
  display: grid; place-items: center;
}
.past-card .thumb img,
.past-card .thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.past-card .thumb .ph {
  font-size: 11px;
  color: var(--muted-2);
}
.past-card .thumb .status-pill {
  position: absolute;
  top: 4px; left: 4px;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.55);
  color: #fff;
}
.past-card .thumb .status-pill.ok {
  background: var(--good-bg, rgba(46, 160, 67, 0.8));
  color: var(--good, #fff);
}
.past-card .thumb .status-pill.err {
  background: var(--bad-bg, rgba(248, 81, 73, 0.8));
  color: var(--bad, #fff);
}
.past-card .thumb .status-pill.warn {
  background: rgba(218, 165, 32, 0.8);
  color: #fff;
}
.past-card .thumb .opening-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  display: grid; place-items: center;
}
.past-card .meta {
  padding: 6px 8px 8px;
  display: flex; flex-direction: column;
  gap: 4px;
  font-size: 11px;
}
.past-card .meta .title {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.past-card .meta .title .muted {
  color: var(--muted-2);
  font-style: italic;
}
.past-card .meta .sub {
  display: flex; align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}
.past-card .meta .sub .dot {
  color: var(--muted-2);
}
.past-card .meta .actions-row {
  display: flex; align-items: center;
  margin-top: 2px;
  gap: 4px;
}
.past-card .meta .job-id {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted-2);
}
.past-card .meta .spacer { flex: 1; }
.past-card .meta .tiny {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 11px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.past-card .meta .tiny.danger:hover {
  background: var(--bad-bg);
  color: var(--bad);
}

/* -------------------- Scene list (ver1 固有) -------------------- */
.scene-list {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 6px 8px 100px;
}
.scene-list::-webkit-scrollbar { width: 10px; }
.scene-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
  border: 2px solid var(--panel);
}

.scene-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px 56px 1fr;
  gap: 10px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: stretch;
  transition: background var(--dur-fast) var(--ease);
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.scene-row:hover { background: var(--panel-2); }
.scene-row.selected {
  background: var(--accent-bg);
  border-color: rgba(56, 139, 253, 0.35);
}
.scene-row .idx {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.scene-row.selected .idx { color: var(--accent); }
.scene-row .thumb {
  aspect-ratio: 9 / 16;
  border-radius: 5px;
  background: var(--bg-deep);
  overflow: hidden;
  position: relative;
  display: grid; place-items: center;
}
.scene-row .thumb img,
.scene-row .thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.scene-row .thumb .telop-mini {
  position: absolute;
  inset: auto 4px 4px;
  font-size: 8.5px;
  text-align: center;
  color: white;
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 1px #000;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.scene-row .meta {
  display: flex; flex-direction: column;
  min-width: 0; gap: 4px;
}
.scene-row .telop-line {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scene-row .narr-line {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.scene-row .status-row {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: auto;
}
.scene-row .duration {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* -------------------- Right pane -------------------- */
.right {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
  background: var(--bg);
}

.detail {
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: var(--space-6);
  padding: var(--space-6);
  align-items: start;
}
.detail::-webkit-scrollbar { width: 10px; }
.detail::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
  border: 2px solid var(--bg);
}

@media (max-width: 1180px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  .preview-col {
    max-width: min(360px, 40vh);
    margin: 0 auto;
    width: 100%;
  }
}
@media (max-width: 720px) {
  .preview-col { max-width: min(260px, 36vh); }
}

.detail-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-4);
  margin-bottom: -4px;
  flex-wrap: wrap;
}
.detail-head h2 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.detail-head .scene-meta {
  font-size: 12px;
  color: var(--muted);
}
.detail-head .spacer { flex: 1; }
.detail-head .nav { display: flex; gap: 4px; }

/* -------------------- Onboarding / empty state -------------------- */
.onboarding {
  grid-column: 1 / -1;
  margin: 0 auto;
  max-width: 640px;
  padding: var(--space-7) var(--space-5);
  text-align: center;
}
.onboarding .icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.7;
}
.onboarding h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.onboarding p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 var(--space-5);
}
.onboarding .steps {
  display: flex; flex-direction: column;
  gap: var(--space-3);
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-top: var(--space-5);
}
.onboarding .steps .step {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--space-4);
  font-size: 13px;
}
.onboarding .steps .step .num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--panel-3);
  color: var(--muted);
  display: grid; place-items: center;
  font-size: 11.5px;
  font-weight: 700;
}
.onboarding .steps .step.done .num {
  background: var(--good-bg);
  color: var(--good);
}
.onboarding .steps .step.active .num {
  background: var(--accent-bg-strong);
  color: var(--accent);
}
.onboarding .steps .step .label {
  color: var(--text-2);
}
.onboarding .steps .step.done .label {
  color: var(--text);
}

/* -------------------- Preview frame -------------------- */
.preview-col {
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.preview-frame {
  width: min(100%, calc((100vh - 220px) * 9 / 16));
  aspect-ratio: 9 / 16;
  max-height: calc(100vh - 220px);
  background: black;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
  align-self: start;
  margin-inline: auto;
}
.preview-frame .media-bg,
.preview-frame .media-bg img,
.preview-frame .media-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.preview-frame .ph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.telop-overlay {
  position: absolute;
  left: 0; right: 0;
  display: flex; justify-content: center;
  padding: 0 20px;
  pointer-events: none;
  z-index: 2;
}
.telop-overlay.pos-top    { top: 8%; }
.telop-overlay.pos-center { top: 50%; transform: translateY(-50%); }
.telop-overlay.pos-bottom { bottom: 14%; }

.telop-text {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  max-width: 100%;
}
.telop-text.style-classic {
  color: white;
  text-shadow:
    -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
    0 0 6px rgba(0,0,0,0.6);
}
.telop-text.style-yellow {
  color: #ffe75c;
  text-shadow:
    -2px -2px 0 #4a2a00, 2px -2px 0 #4a2a00, -2px 2px 0 #4a2a00, 2px 2px 0 #4a2a00;
}
.telop-text.style-pink {
  color: #ffb6d5;
  text-shadow:
    -2px -2px 0 #4a0028, 2px -2px 0 #4a0028, -2px 2px 0 #4a0028, 2px 2px 0 #4a0028;
}
.telop-text.style-neon {
  color: #b9ffe5;
  text-shadow:
    0 0 8px #00d9a3, 0 0 14px #00d9a3, 0 0 20px #00d9a3;
}

.preview-actions {
  display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap;
}
.preview-actions .spacer { flex: 1; }

.kind-tag {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.06em;
  z-index: 3;
}

/* -------------------- Editor side -------------------- */
.editor-col {
  display: flex; flex-direction: column; gap: 18px;
  min-width: 0;
}
.editor-card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.editor-card h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: var(--space-3);
}
.editor-card h3 .spacer { flex: 1; }

.field-row {
  display: flex; gap: var(--space-3); align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.field-row .label-mini {
  font-size: 11px;
  color: var(--muted);
  margin-right: 4px;
}

textarea.telop-input {
  width: 100%;
  min-height: 64px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
textarea.narr-input {
  width: 100%;
  min-height: 96px;
  font-size: 13.5px;
  line-height: 1.7;
}

.synth-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.synth-row .status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.presets {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: var(--space-3);
}
.presets .label-mini {
  font-size: 11px;
  color: var(--muted);
  margin-right: 4px;
  width: 100%;
}
.custom-input {
  display: flex; gap: 6px;
  margin-top: var(--space-3);
}
.custom-input input { flex: 1; font-size: 12px; }

.history {
  margin-top: var(--space-4);
  padding: var(--space-3) 10px;
  background: var(--bg-deep);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: flex-start; gap: var(--space-3);
}
.history .prev-text {
  flex: 1;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.55;
}
.history .from-note {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-style: normal;
  margin-bottom: 2px;
}

/* -------------------- Bottom action bar -------------------- */
.actionbar {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: var(--space-4) var(--space-6);
  display: flex; align-items: center; gap: var(--space-4);
  flex-wrap: wrap;
}
.actionbar .stat {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.actionbar .stat strong {
  color: var(--text);
  font-weight: 600;
}
.actionbar .progress {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--muted);
  min-width: 220px;
}
.actionbar .progress .bar {
  flex: 1; height: 4px;
  background: var(--panel-3);
  border-radius: 2px;
  overflow: hidden;
}
.actionbar .progress .bar .fill {
  height: 100%; background: var(--accent);
  width: 0%; transition: width var(--dur-base) var(--ease);
}
.actionbar .progress .pct {
  font-family: var(--mono);
  min-width: 36px;
  text-align: right;
}

/* -------------------- Modal (進捗 / 結果) -------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: grid; place-items: center;
  padding: var(--space-5);
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  width: min(720px, 100%);
  max-height: 92vh;
  display: flex; flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}
.modal h3 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.modal h3 .spacer { flex: 1; }
.modal-body {
  display: flex; flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
}

/* 進捗モーダル */
.job-progress {
  display: flex; flex-direction: column;
  gap: var(--space-4);
}
.job-progress .phase {
  font-size: var(--fs-md);
  color: var(--text);
  display: flex; align-items: center; gap: var(--space-3);
}
.job-progress .pct-big {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  text-align: center;
  margin-top: var(--space-3);
}
.logs {
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  list-style: none;
  margin: 0;
}
.logs li { padding: 1px 0; display: flex; gap: var(--space-3); }
.logs .ts { color: var(--muted-2); flex-shrink: 0; }
.logs::-webkit-scrollbar { width: 8px; }
.logs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }

/* 結果モーダル */
.result-video {
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  background: black;
  border-radius: var(--radius-lg);
  display: block;
  margin: 0 auto;
}
.result-meta {
  display: flex; align-items: center;
  gap: var(--space-4);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.result-meta .spacer { flex: 1; }

/* -------------------- Toast -------------------- */
.toast-stack {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: var(--z-toast);
  display: flex; flex-direction: column-reverse;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 360px;
  pointer-events: auto;
}
.toast.err { border-left-color: var(--bad); color: var(--text); }
.toast.ok  { border-left-color: var(--good); }
