/* 色（2026-10-27 に LP の見本で決めた。stage2/lp-trial.md の「見た目」）。白い紙と墨色、黄色のマーカー 1 色、方眼。紫は使わない。
   基本はダーク（各 HTML の <html data-theme="dark">。2026-11-08 にライトから変えた）。右上のボタンで選ぶと data-theme が変わる
   （選んだ方は localStorage に覚える。index.html の頭と app.js の setTheme）。
   --page 地・--ink 墨（文字・線・ボタン）・--muted 薄い文字・--grid 方眼・--marker マーカー が決めた 5 色。ほかはそこから作る */
:root {
  color-scheme: light;
  --page: #ffffff;
  --ink: #1f1e1c;
  --muted: #5e5c57;
  --grid: rgba(31, 30, 28, .08);
  --marker: #ffe15a;
  --marker-ink: #1f1e1c; /* マーカーの上の文字 */
  --surface: #fbfaf7;
  --ink-2: #3f3d39;
  --line: #e3e1db;
  --line-strong: #c9c6be;
  --accent: var(--ink); /* ボタン・選んだもの・リンクは墨。目立たせたい所はマーカー */
  --accent-ink: var(--page);
  --error: #c4352f;
  --good: #1f7a3a;
  --field: #ffffff;
  --sel: rgba(255, 225, 90, .35); /* 選んだ行・カードの地（マーカーを薄く） */
  --frame: 0 0 0 1px var(--line-strong);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #191918;
    --ink: #f1efe9;
    --muted: #a9a69e;
    --grid: rgba(241, 239, 233, .09);
    --marker: #e8c547;
    --marker-ink: #191918;
    --surface: #212120;
    --ink-2: #d2cfc7;
    --line: #34332f;
    --line-strong: #4d4b46;
    --error: #ec7a72;
    --good: #5cc27a;
    --field: #262624;
    --sel: rgba(232, 197, 71, .18);
    --frame: 0 0 0 1px var(--line-strong), 0 0 0 6px var(--surface);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #191918;
  --ink: #f1efe9;
  --muted: #a9a69e;
  --grid: rgba(241, 239, 233, .09);
  --marker: #e8c547;
  --marker-ink: #191918;
  --surface: #212120;
  --ink-2: #d2cfc7;
  --line: #34332f;
  --line-strong: #4d4b46;
  --error: #ec7a72;
  --good: #5cc27a;
  --field: #262624;
  --sel: rgba(232, 197, 71, .18);
  --frame: 0 0 0 1px var(--line-strong), 0 0 0 6px var(--surface);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.6 "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
}
a { color: var(--ink); text-decoration-color: var(--muted); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--ink); }
/* マーカーを引いた文字（LP の見出しなど） */
/* ダークでは文字が明るいので、マーカーを下に寄せて字と重なる所を減らす */
mark, .marker { background: linear-gradient(transparent var(--mark-top, 55%), var(--marker) var(--mark-top, 55%), var(--marker) 92%, transparent 92%); color: inherit; padding: 0 .1em; }
:root[data-theme="dark"] { --mark-top: 72%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mark-top: 72%; } }
/* 右上のライト・ダークの切り替え（月はライトのとき、太陽はダークのときに出す） */
.theme-btn { margin-left: auto; display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; align-self: center; }
.theme-btn .theme-sun { display: none; }
:root[data-theme="dark"] .theme-btn .theme-sun { display: block; }
:root[data-theme="dark"] .theme-btn .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .theme-moon { display: none; }
}
h1 { font-size: 1.4rem; margin: 0 0 4px; line-height: 1.35; }
h2 { font-size: 1.1rem; margin: 0; }

.top {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--page); border-bottom: 1px solid var(--line);
}
.top { align-items: center; }
@media (max-width: 640px) { .top .tagline { display: none; } } /* スマホではヘッダーを短く */
.brand { font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.tagline { color: var(--muted); font-size: .85rem; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* 狭いときは省略して、右のボタンを 1 行に残す */
/* 横幅はサイト全体で同じ（2026-10-23。それまでは結果の画面だけ 1680px、ほかは 1120px）。文章とフォームは読みやすい幅で止める */
main { max-width: 1680px; margin: 0 auto; padding: 16px; }
main p, .form, .doc-table { max-width: 52em; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; margin: 16px 0;
}
.card > h1, .card > h2 { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
details.card > summary { cursor: pointer; font-weight: 600; }
.score { width: 100%; height: auto; margin-top: 12px; border-radius: 6px; }

.meta, .muted, .hint { color: var(--muted); }
.meta { margin: 0 0 8px; font-size: .9rem; }
.hint { font-size: .9rem; margin: 8px 0 0; }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.back { margin: 0 0 8px; }
.note { color: var(--ink-2); }
.error { color: var(--error); font-weight: 600; }
.notice { color: var(--good); font-weight: 600; }
.plan-line { margin: 0 0 12px; font-size: .9rem; color: var(--ink-2); }
.plan-line .plan-change { color: var(--error); font-weight: 700; } /* 下げる・解約の予定（ユーザーの希望で赤く） */
.plan-line.warn { padding: 6px 10px; border-left: 3px solid var(--error); font-weight: 600; }
/* 友だちに紹介する（トップ。stage2/referral.md） */
.ref-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.ref-label { font-size: .85rem; color: var(--ink-2); min-width: 7em; }
.ref-code { font-size: 1.1rem; font-weight: 700; letter-spacing: .08em; padding: 2px 8px; border: 1px dashed currentColor; border-radius: 4px; }
.ref-url { flex: 1 1 16em; min-width: 0; }
#ref-input { width: 12em; text-transform: uppercase; }
/* 分析の確認：使う前と使ったあとのクレジット（ボタンのすぐ上） */
.confirm .credit-flow { margin: 12px 0 0; font-size: .95rem; }
.credit-flow b { font-size: 1.1rem; }
.credit-flow.short { color: var(--error); font-weight: 600; }
/* クレジットが足りないときの案内（有料プラン・友だちの紹介） */
.more-credits { margin: 6px 0 0; }
.more-credits a { margin-right: 8px; font-weight: 600; }

.form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.field.wide { flex: 1 1 320px; }
.field.narrow input { width: 8em; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
textarea { width: 100%; resize: vertical; min-width: 14em; }
button {
  font: inherit; cursor: pointer; padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
button:hover:not(:disabled) { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.c-rank { width: 204px; }
.c-time { white-space: nowrap; width: 96px; }
.c-time input { width: 5.6em; font-variant-numeric: tabular-nums; display: block; }
.c-time input + input { margin-top: 6px; }
.c-title { width: 24%; min-width: 220px; }
.c-title textarea { min-width: 0; }
.c-basis { color: var(--ink-2); min-width: 240px; font-size: .82rem; line-height: 1.5; }
table.cands th, table.cands td { padding: 8px 5px; }
.c-ops { width: 184px; }
.c-ops button { padding: 4px 8px; font-size: .85rem; width: 100%; }
.c-ops .edit-btns { flex-direction: row; }
.c-ops .edit-btns button { flex: 1; }
.c-ops .c-mat { margin-top: 6px; }
.badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  font-size: .7rem; background: var(--accent); color: var(--accent-ink); vertical-align: middle;
}

.status { font-size: .8rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.s-running { border-color: var(--accent); color: var(--accent); }
.s-done { border-color: var(--good); color: var(--good); }
.s-error { border-color: var(--error); color: var(--error); }

.vods { list-style: none; margin: 0; padding: 0; }
.vods li { border-bottom: 1px solid var(--line); }
.vods a { display: flex; gap: 12px; align-items: center; padding: 10px 4px; text-decoration: none; color: var(--ink); }
.vods a:hover .vod-title { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 3px; }
.vod-text { min-width: 0; }
.vod-title { display: block; font-weight: 600; }
.thumb { width: 160px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; flex: none; background: var(--line); }
.thumb-empty { display: block; }
.vod-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.thumb-lg { width: 320px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
@media (max-width: 640px) { .thumb { width: 112px; } }

.job {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 12px 0;
  border: 1px solid var(--line-strong); border-left: 4px solid var(--marker); border-radius: 8px; background: var(--surface);
}
.job[hidden] { display: none; }
/* 分析の進み具合のバー（2026-10-23。app.js の progressBar） */
.job { flex-wrap: wrap; }
.job-progress { flex-basis: 100%; }
.job-progress:empty { display: none; }
.pbar-row { display: flex; align-items: center; gap: 10px; }
.pbar { display: block; flex: 1; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.pbar > span {
  display: block; height: 100%; border-radius: 999px; transition: width .8s ease;
  background: var(--marker) linear-gradient(-45deg, rgb(255 255 255 / .18) 25%, transparent 25%, transparent 50%,
    rgb(255 255 255 / .18) 50%, rgb(255 255 255 / .18) 75%, transparent 75%) 0 0 / 20px 20px;
  animation: pbar-flow 1s linear infinite; /* 止まっていないことが分かるよう、縞が流れる */
}
@keyframes pbar-flow { to { background-position: 20px 0; } }
@media (prefers-reduced-motion: reduce) { .pbar > span { animation: none; } }
.pbar.idle > span { animation: none; } /* 取り込みアプリを待っている間（まだ動いていない） */
.pbar.compact { height: 5px; max-width: 320px; margin-top: 6px; }
.pbar-pct { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3em; text-align: right; }
.pbar-eta { font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.psteps { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 6px 0 0; font-size: .8rem; color: var(--muted); }
.psteps li.done { color: var(--ink-2); }
.psteps li.done::before { content: "✓ "; color: var(--good); }
.psteps li.now { color: var(--accent); font-weight: 700; }
.psteps li.now::before { content: "● "; }
/* 初めての人向けの使い方（2026-10-23。まだ 1 本も分析していない人の最初のページ） */
.intro { margin: 16px 0; }
.intro[hidden] { display: none; }
.intro h2 { margin-bottom: 10px; }
.intro-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.intro-steps li {
  counter-increment: step; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 14px 56px; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.intro-steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--marker); color: var(--marker-ink); font-weight: 700;
}
.intro-steps span { color: var(--ink-2); font-size: .9rem; }
/* 失敗したときの案内（2026-10-23。app.js の failureHtml） */
.fail { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--error); border-left-width: 4px; border-radius: 8px;
  background: var(--surface); color: var(--ink); font-weight: 400; }
.fail p { margin: 0 0 6px; }
.fail .fail-head { color: var(--error); font-weight: 700; }
.fail details { margin: 4px 0 8px; color: var(--ink-2); }
.fail summary { cursor: pointer; }
.fail-detail { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; font-size: .8rem; }
#job-error:has(.fail) { color: inherit; font-weight: 400; }
/* 分析が終わったときの知らせ（2026-10-23。app.js の toast・notifyOption） */
.notify-opt { margin-left: auto; }
.notify-opt:empty { display: none; }
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px; border-radius: 8px; border: 1px solid var(--good); background: var(--surface); color: var(--ink);
  box-shadow: 0 6px 20px rgb(0 0 0 / .35); text-decoration: none; font-weight: 600;
}
.toast.bad { border-color: var(--error); }
.toast + .toast { bottom: 84px; }
.spinner {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.shorts figure { margin: 0; }
.shorts video { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; display: block; box-shadow: var(--frame); }
.shorts figcaption { font-size: .85rem; margin-top: 6px; color: var(--ink-2); }

/* ---- 段階2（web/）で足したもの */
.top .spacer { flex: 1; }
.user { color: var(--ink-2); font-size: .9rem; }
.linkish { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: .9rem; }
.login { max-width: 460px; margin: 32px auto; }
.login .providers { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 20px; }
.login .providers button { padding: 10px 14px; font-weight: 600; }
/* Google のログインボタン（2026-10-23。よくある白地に「G」のマークの形。Google の決まりの色） */
.login .providers .google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 6px; font-weight: 500;
}
.login .providers .google-btn:hover { background: #f2f2f2; border-color: #747775; }
.google-g { flex: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 8px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); margin-top: 10px; }
.check input { margin-top: 4px; }
.vods .row { display: flex; gap: 12px; align-items: center; padding: 10px 4px; }
.vods .row .vod-text { flex: 1; }
.vods .vod-text .status { display: inline-block; margin-left: 6px; }
.expire { color: var(--error); }

/* ---- 素材のダウンロード（候補の表の「素材」の欄と、画質を選ぶ窓） */
.mat-line { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.spinner.sm { width: 12px; height: 12px; border-width: 2px; }
.dialog {
  width: min(440px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
.dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog h2 { margin-bottom: 6px; }
.choices { border: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.choices legend { padding: 0; margin-bottom: 4px; }
.choices label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
/* 候補をこのページで見る窓（2026-10-27。Twitch の埋め込みプレイヤー） */
.dialog-watch { width: min(900px, calc(100% - 32px)); }
.watch-top { display: flex; align-items: baseline; gap: 12px; }
.watch-top h2 { flex: 1; min-width: 0; margin: 0 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-player { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: 6px; overflow: hidden; }
.watch-player iframe { display: block; width: 100%; height: 100%; border: 0; }
.watch-player .error { padding: 16px; }
.dialog-watch .dialog-actions { flex-wrap: wrap; align-items: center; }

/* ---- 候補の表の「編集」の欄と、AI 編集の窓 */
.edit-btns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ai-prompt { margin-top: 4px; min-width: 0; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.chip { padding: 2px 10px; border-radius: 999px; font-size: .8rem; color: var(--ink-2); }
.ai-status { display: flex; gap: 10px; align-items: center; margin: 12px 0 0; font-weight: 600; }
.ai-status .spinner[hidden] { display: none; }
.ai-warn { margin: 10px 0 0; padding: 6px 10px; border-left: 3px solid var(--error); color: var(--ink-2); font-weight: 600; }

/* ---- 編集画面（web/editor.js） */
/* 見出しは 1 行（戻るリンク・題・VOD 名と保存の状態・ボタン。2026-10-24 にプレビューを大きくするため詰めた） */
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.ed-title { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; min-width: 0; }
.ed-title h1 { margin: 0; font-size: 1.25rem; }
.ed-head .meta { margin: 0; }
.ed-save { font-size: .85rem; color: var(--muted); align-self: center; margin-right: 4px; white-space: nowrap; max-width: 22em; overflow: hidden; text-overflow: ellipsis; }
.ed-save.dirty { color: var(--ink-2); }
.ed-save.bad { color: var(--error); font-weight: 600; }
/* 左に文字の一覧・真ん中にプレビュー・右に設定（2026-10-22）。狭い画面では設定を下に、さらに狭いと縦に並べる */
.editor {
  /* 2026-10-24：プレビューを 3 割小さくし、文字の一覧は 3 割広く（480 → 624px）、設定の欄は余りを全部使う（ユーザーの要望） */
  display: grid; grid-template-columns: minmax(230px, 624px) auto minmax(260px, 1fr); grid-template-areas: "texts stage side";
  gap: 16px; margin: 8px 0; align-items: start;
}
.ed-texts { grid-area: texts; }
.ed-stage { grid-area: stage; }
.ed-side { grid-area: side; }
@media (max-width: 1060px) {
  .editor { grid-template-columns: minmax(220px, 416px) 1fr; grid-template-areas: "texts stage" "side side"; }
}
.ed-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
/* 2026-10-24：タイムラインまで 1 画面に収める（ユーザーの要望）。--fit-h は編集の欄に使える高さで、
   editor.js の fitLayout が「画面の高さ − 欄より上 − タイムライン」を測って入れる（測る前は目安の値）。
   プレビューはそこから再生の行（約 48px）を、文字の一覧は見出しと説明（約 105px）を引いた高さ */
.editor { --fit-h: calc(100vh - 380px); --pv-h: clamp(240px, var(--fit-h) - 48px, 75vh); --pv-w: calc(var(--pv-h) * 9 / 16); }
/* 3 列の並びでは、真ん中の列がプレビューの幅を必ず取る（左右の欄に押されて細くならないように）。
   右の設定の欄も、長いときは欄の中で巻き取る（行の高さを伸ばしてタイムラインを押し下げない） */
@media (min-width: 1061px) {
  .ed-stage { min-width: var(--pv-w); }
  .ed-side { max-height: max(330px, var(--fit-h)); overflow-y: auto; }
}
/* 2 列以下の並びでは設定の欄がプレビューの下に回り、タイムラインはどのみち 1 画面に収まらないので、画面の高さで決める */
@media (max-width: 1060px) { .editor { --pv-h: clamp(240px, 100vh - 330px, 60vh); } }
/* 大きく見る（2026-10-24）：プレビューと再生の行だけを画面いっぱいに */
.ed-stage.big {
  position: fixed; inset: 0; z-index: 50; justify-content: center; padding: 16px;
  background: rgb(0 0 0 / .88); min-width: 0;
}
.ed-stage.big .ed-canvas-wrap { width: min(100%, calc((100vh - 90px) * 9 / 16)); }
.ed-canvas-wrap {
  position: relative; width: min(100%, var(--pv-w)); aspect-ratio: 9 / 16;
  background: #000; border-radius: 8px; overflow: hidden; box-shadow: var(--frame);
}
#ed-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.ed-overlay {
  position: absolute; inset: 0; display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: #fff; background: rgb(0 0 0 / .6); font-size: .9rem; line-height: 1.5;
}
.ed-overlay[hidden] { display: none; }
#ed-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ed-side { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 14px; min-height: 320px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 -6px 12px; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--ink-2); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.ed-panel h3 { font-size: 1rem; margin: 4px 0 10px; }
.ed-panel .actions { margin-top: 12px; }
.field-row { display: grid; grid-template-columns: 8em 1fr auto; gap: 8px; align-items: center; margin: 8px 0; font-size: .9rem; color: var(--ink-2); }
.field-row output { min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.field-row input.num { width: 9em; font-variant-numeric: tabular-nums; }
.field-row input[type=range] { width: 100%; padding: 0; }
.rect-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rect-btns { display: flex; gap: 6px; flex: none; }
.keys { padding-left: 1.2em; }
.usage { margin: 8px 0 10px; }
.usage-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.usage-bar span { display: block; height: 100%; background: var(--accent); }
.upload { position: relative; display: inline-block; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.button-like { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.upload:focus-within .button-like { outline: 2px solid var(--accent); }
.assets { list-style: none; padding: 0; margin: 10px 0 0; }
.assets li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.assets .a-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assets button { padding: 3px 10px; }

/* レイアウトの種類（見本の絵つきのカード） */
.lay-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 10px; }
.lay-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; text-align: center;
  border: 2px solid var(--line); border-radius: 8px; background: var(--surface); line-height: 1.35;
}
.lay-card[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); }
.lay-thumb { width: 72px; height: 128px; border-radius: 4px; background: #000; display: block; }
.lay-name { font-weight: 600; font-size: .9rem; }
.lay-card:disabled { cursor: not-allowed; }
.lay-card:disabled .lay-thumb { opacity: .4; }
.lay-soon { display: block; width: fit-content; margin: 2px auto 0; padding: 0 6px; border-radius: 999px; font-size: .7rem; font-weight: 600; background: var(--line); color: var(--muted); }
.choices.inline { flex-direction: row; gap: 16px; margin: 6px 0; align-items: center; }
.choices.inline legend { float: left; margin-right: 8px; }

/* プレビューの上で文字を直す入力欄（位置・大きさは editor.js が文字に合わせて決める） */
.ed-inline {
  position: absolute; z-index: 3; min-width: 0; resize: none; overflow: hidden; text-align: center; font-weight: 700;
  color: #fff; background: rgb(0 0 0 / .6); border: 2px solid #3987e5; border-radius: 6px; padding: 2px 6px;
  -webkit-text-stroke: 0; caret-color: #fff;
}
.ed-inline:focus { outline: none; }

/* 文字の一覧（画面の左。2026-10-22 に右の欄のタブから移した） */
.ed-texts { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; min-width: 0; }
.ed-texts .hint { margin: 2px 0 6px; }
.tx-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.tx-head h3 { margin: 4px 0; font-size: 1rem; }
.tx-add { display: flex; gap: 4px; }
.tx-add button { padding: 4px 8px; font-size: .85rem; }
.text-list { list-style: none; padding: 0; margin: 0; max-height: max(225px, calc(var(--fit-h) - 105px)); overflow-y: auto; }
.text-list li { display: flex; flex-direction: column; gap: 3px; padding: 6px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; border-radius: 6px; }
.text-list li.now { border-left-color: #e5484d; }
.text-list li.sel { background: var(--sel); }
.text-list li.empty { border: none; }
.tx-meta { display: flex; flex-wrap: wrap; gap: 4px 4px; align-items: center; font-size: .8rem; }
.tx-meta > * { white-space: nowrap; flex: none; }
/* 表示の開始・終了の欄（2026-10-23。押すとその場で直せる入力欄に見せる） */
.tx-times { display: flex; align-items: center; gap: 2px; }
.text-list input.tx-time { width: 4.1em; padding: 1px 3px; font-size: .8rem; font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 4px; background: var(--field); color: var(--ink); }
.text-list input.tx-time:hover { border-color: var(--muted); }
.text-list input.tx-time:focus { border-color: var(--accent); outline: none; }
.tx-go { padding: 0 5px; font-size: .72rem; line-height: 1.5; }
.tx-kind { font-size: .7rem; color: #fff; border-radius: 999px; padding: 0 5px; width: fit-content; }
.tx-kind.text { background: #7048c8; }
.tx-kind.comment { background: #c0571b; }
.text-list textarea.tx-text { min-width: 0; width: 100%; resize: vertical; padding: 4px 6px; }
.tx-del { padding: 0 7px; margin-left: auto; line-height: 1.5; }

/* コメントの枠のデザイン（右の欄） */
.cm-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.cm-style { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 2px solid var(--line); border-radius: 8px; background: var(--surface); }
.cm-style[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); }
.cm-swatch { display: inline-block; padding: 2px 10px; border-radius: 8px; border: 2px solid; font-weight: 700; }
/* 文字のフォントと見た目（2026-10-22）。フォントの見本の絵は白い字なので、ボタンは暗い地にする */
.fx-label { margin: 10px 0 4px; color: var(--muted); }
.font-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.font-btn, .look-btn { border: 2px solid var(--line); border-radius: 8px; background: #2b2d33; padding: 4px 2px; min-width: 0; }
.font-btn { display: flex; align-items: center; justify-content: center; height: 40px; }
.font-btn img { max-width: 100%; height: 24px; object-fit: contain; }
.look-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.look-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #ddd; }
.look-btn canvas { width: 96px; max-width: 100%; height: auto; background: #6b6f78; border-radius: 4px; }
.font-btn[aria-pressed="true"], .look-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* スタイル（2026-11-01。フォント・色・フチをまとめた見た目。見本の絵は worker/text_styles.py が libass で描く） */
.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.style-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 4px;
  border: 2px solid var(--line); border-radius: 8px; background: #2b2d33; color: #ddd; }
.style-btn img { width: 100%; max-width: 180px; height: auto; border-radius: 4px; }
.style-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* 帯（2026-11-04。文字の後ろの四角） */
.band-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.band-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 2px solid var(--line); border-radius: 8px;
  background: #2b2d33; color: #ddd; font-size: .8rem; cursor: pointer; }
.band-btn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.band-chip { width: 14px; height: 14px; border-radius: 3px; border: 1px solid #0006; }
.band-btn input[type="color"] { width: 22px; height: 18px; padding: 0; border: 0; background: none; }
.look-more { margin: 8px 0; }
.look-more summary { cursor: pointer; color: var(--accent); }
.look-more input[type="color"] { width: 44px; height: 28px; padding: 0 2px; border: 1px solid var(--line); background: none; }
/* 効果音のメニュー（タイムラインの道具の並びの「＋ 効果音 ▾」） */
.sfx-menu-wrap { position: relative; }
.sfx-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 10; width: 290px; padding: 8px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / .35);
}
.sfx-menu[hidden] { display: none; }
.sfx-menu p { margin: 0 0 6px; }
.sfx-menu ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.sfx-menu li { display: flex; gap: 4px; }
.sfx-menu .sfx-try { padding: 2px 7px; }
.sfx-menu .sfx-pick { flex: 1; min-width: 0; text-align: left; padding: 3px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 効果音の一覧（音・音源のタブ） */

/* タイムライン */
.tl { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 8px 0 12px; user-select: none; }
.tl-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.tl-tools .spacer { flex: 1; }
.tl-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
/* 再生のボタンと時刻（2026-10-23。プレビューのすぐ下に置く） */
.ed-transport { display: flex; gap: 6px 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.t-play { min-width: 52px; padding: 5px 12px; font-size: 1.05rem; }
.t-time { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.t-icon { padding: 4px 7px; line-height: 1.2; }
/* プレビューで聞く音量（書き出しには入らない。2026-10-24）。🔊 を押すと上につまみが出る */
.t-vol-wrap { position: relative; }
.t-monitor {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; gap: 6px; align-items: center; width: 220px; padding: 6px 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--frame);
}
.t-monitor[hidden] { display: none; }
.t-monitor input[type=range] { flex: 1; min-width: 0; }
.t-vol-v { min-width: 3.2em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.t-scale { display: flex; gap: 6px; align-items: center; }
.tl-body { display: flex; }
.tl-heads { flex: none; width: 64px; border-right: 1px solid var(--line); }
.tl-head { display: flex; align-items: center; padding: 0 8px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.tl-head-ruler, .tl-ruler { height: 22px; }
.tl-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.tl-inner { position: relative; min-width: 100%; touch-action: none; }
.tl-ruler { position: relative; border-bottom: 1px solid var(--line); cursor: pointer; }
.tick { position: absolute; top: 3px; font-size: .7rem; color: var(--muted); padding-left: 3px; border-left: 1px solid var(--line); line-height: 16px; }
.tl-row { position: relative; border-bottom: 1px solid var(--line); }
.bar {
  position: absolute; top: 3px; bottom: 3px; border-radius: 5px; overflow: hidden; display: flex; align-items: center;
  font-size: .75rem; cursor: grab; border: 1px solid transparent; color: #fff;
}
.tl-row[data-row=text] .bar, .tl-row[data-row=track] .bar { bottom: auto; height: 20px; } /* ROW_H.lane（editor.js）− 4 */.bar .lbl { flex: 1; min-width: 0; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.bar .h { width: 8px; align-self: stretch; cursor: ew-resize; flex: none; }
.bar:hover .h, .bar.sel .h { background: rgb(255 255 255 / .4); }
.bar.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.bar-clip { background: #2a78d6; cursor: pointer; }
.bar-zoom { background: #b87900; }
.bar-effect.freeze { background: #3a6ea5; }
.bar-effect.shake { background: #a5452d; }
.bar-effect.flash { background: #8a7a12; }
.bar-text.title { background: #7048c8; }
.bar-text.telop { background: #7048c8; } /* タイトルと同じ色（画面ではどちらも「文字」） */
.bar-text.comment { background: #c0571b; }
.bar-track { background: #0a7d4a; }
.bar-track.sfx { background: #127c8c; }
.bar-track.missing { background: var(--error); }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #e5484d; pointer-events: none; z-index: 2; }
.dialog-wide { width: min(780px, calc(100% - 32px)); }
.dialog-xwide { width: min(980px, calc(100% - 32px)); }
/* レイアウトを編集する窓（2026-10-27。左に元の映像と枠、右にできあがり） */
.lay-modes { display: flex; gap: 6px; margin: 4px 0 8px; }
.lay-modes button[aria-pressed="true"] { border-color: var(--accent); background: var(--sel); }
.lay-edit { display: flex; gap: 16px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.lay-edit figure { margin: 0; min-width: 0; }
.lay-edit figure:first-child { flex: 1 1 400px; max-width: 640px; }
.lay-edit figcaption { margin-top: 4px; text-align: center; }
.lay-src, .lay-out { display: block; touch-action: none; border-radius: 6px; background: #000; box-shadow: var(--frame); }
.lay-src { width: 100%; height: auto; }
.lay-out { width: auto; height: auto; max-height: 360px; max-width: 100%; }
.rect-canvas { display: block; max-width: 100%; margin: 8px auto 0; cursor: crosshair; touch-action: none; border-radius: 6px; background: #000; box-shadow: var(--frame); }
.dialog-actions .spacer { flex: 1; }
@media (max-width: 760px) { .editor { grid-template-columns: 1fr; grid-template-areas: "stage" "texts" "side"; } }

/* ---- プランと料金（#/plans） */
.top .nav { font-size: .9rem; }
/* ヘッダーの「ログイン」（文字だけ）と「無料で始める」（マーカー色。2026-11-10） */
.hdr-login, .hdr-signup { font-size: .9rem; font-weight: 700; border-radius: 999px; padding: 6px 14px; }
.hdr-login { background: none; border: 1px solid transparent; color: var(--ink); }
.hdr-login:hover:not(:disabled) { border-color: var(--line-strong); }
.hdr-signup { background: var(--marker); color: var(--marker-ink); border: 2px solid var(--ink); }
.hdr-signup:hover:not(:disabled) { border-color: var(--ink); opacity: .9; }
.hdr-login[hidden], .hdr-signup[hidden] { display: none; }
/* 狭い画面では 1 行に収める（「トコダケについて」はログインしていなければトップと同じなので隠す） */
@media (max-width: 640px) { .top:has(#hdr-signup:not([hidden])) .nav[href="#/about"] { display: none; } }
/* ログイン中は「友だち紹介」「作業画面」「ログアウト」が並ぶので、狭い画面では「トコダケについて」を隠して 1 行に収める */
@media (max-width: 640px) { .top:has(#user:not([hidden])) .nav[href="#/about"] { display: none; } }
/* スマホの幅では「プランと料金」も隠す（作業画面の上の「プランを見る・変える」から行ける） */
@media (max-width: 480px) { .top:has(#user:not([hidden])) .nav[href="#/plans"] { display: none; } }
@media (max-width: 480px) {
  .top { gap: 4px; padding: 10px 12px; }
  .top .nav { margin-right: 4px; }
  .top .nav { font-size: .8rem; }
  .hdr-login, .hdr-signup { font-size: .8rem; padding: 5px 9px; }
  .hdr-login { padding: 5px 4px; }
}
a.button {
  display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.plan { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan h2 { margin: 0; }
.plan .price { font-size: 1.6rem; font-weight: 700; margin: 0; }
.plan .price span { font-size: .85rem; font-weight: 400; color: var(--ink-2); }
.plan ul { margin: 0; padding-left: 1.2em; font-size: .9rem; flex: 1; }
.plan li { margin: 4px 0; }
.plan button, .plan a.button { align-self: flex-start; }
.rules { padding-left: 1.2em; font-size: .9rem; color: var(--ink-2); }
.rules li { margin: 6px 0; }

/* ---- LP（ログイン前のトップ・#/about。2026-10-24。stage2/lp-onboarding-requirements.md） */
/* 見本の文字は編集画面と同じフォントのファイル（30 日キャッシュ）。LP の見本でだけ使うので、名前を分けて必要なときだけ読む */
@font-face { font-family: "lp-mincho"; src: url("fonts/mincho.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "lp-maru"; src: url("fonts/maru.woff2") format("woff2"); font-display: swap; }
.lp-alert {
  margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--error); border-left-width: 4px; border-radius: 8px;
  background: var(--surface); max-width: 52em;
}
.lp-alert b { display: block; color: var(--error); }
/* LP の地は 40px の方眼（2026-10-27。app.js の route が LP のときだけ body に .lp を付ける） */
body.lp {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px; background-position: center top;
}
/* ヒーロー：1 列・中央寄せ（2026-11-09。競合の LP にならい、見出し → 説明 → URL の欄 → ひとこと → ログインだけ。右の絵はやめた） */
.lp-hero { max-width: 860px; margin: 0 auto; padding: 56px 0 24px; text-align: center; }
.lp-hero p { margin-left: auto; margin-right: auto; }
.lp-hero .job { justify-content: center; }
.lp-hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.4rem); line-height: 1.4; font-weight: 700; margin: 0 0 16px;
  letter-spacing: .01em; word-break: auto-phrase;
}
.lp-lead { color: var(--muted); margin: 0 auto 30px; font-size: 1.08rem; line-height: 1.8; max-width: 34em; word-break: auto-phrase; }
.lp-hero .providers { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.lp-hero .providers button { padding: 12px 16px; font-weight: 700; }
/* ボタンは墨色 1 つ（Google の暗い色のボタンの形：白い丸に G のマーク） */
.lp-hero .providers .google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--ink); color: var(--page); border: 1px solid var(--ink); border-radius: 999px;
}
.lp-hero .providers .google-btn .google-g { background: #fff; border-radius: 50%; padding: 4px; width: 26px; height: 26px; }
.lp-hero .providers .google-btn:hover:not(:disabled) { border-color: var(--ink); opacity: .88; }
.lp-hero .hint { color: var(--muted); }
.lp-cta { padding: 12px 24px; font-size: 1rem; border-radius: 999px; }
.lp-email { margin-top: 12px; }
.lp-section { max-width: 1120px; margin: 40px auto 0; }
.lp-section > h2 { font-size: 1.3rem; margin-bottom: 6px; }
.lp-section > .hint { margin: 0 0 14px; }
.lp-section > h2.lp-catch { font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.35; margin-bottom: 4px; }
.lp-sub { margin: 0 0 16px; color: var(--ink-2); font-size: 1.02rem; }
.lp-lead b { color: var(--ink); }
.lp-section[hidden] { display: none; }

/* 見本のショート（縦 9:16 の絵に、HTML の文字を重ねる。文字の大きさは絵の幅に合わせる：cqw は絵の幅の 1%。
   書き出しの 1080px の画面での既定の大きさ（timeline.js の TITLE_DEFAULT など × TEXT_EM 0.77）より 3 割ほど大きくした
   （LP の小さな絵でも読めるように。編集画面で大きさを変えた形） */
.lp-samples { display: flex; gap: 20px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.lp-sample { margin: 0; flex: none; width: 260px; scroll-snap-align: start; }
.lp-sample[hidden] { display: none; }
.lp-short {
  position: relative; container-type: inline-size; aspect-ratio: 9 / 16; overflow: hidden;
  border-radius: 12px; background: #000; box-shadow: var(--frame);
}
.lp-short img { display: block; width: 100%; height: 100%; }
.lp-sample figcaption { margin-top: 10px; font-size: .78rem; color: var(--muted); line-height: 1.5; }
.lp-sample figcaption b { color: var(--ink-2); font-size: .85rem; }
.lp-tx {
  position: absolute; left: 50%; transform: translate(-50%, -50%); width: max-content; max-width: 89cqw;
  text-align: center; line-height: 1.115; font-weight: 400; color: #fff; white-space: pre-wrap;
  -webkit-text-stroke: 1.6cqw #000; paint-order: stroke fill;
}
.lp-title { font-family: "lp-mincho", serif; font-size: 7cqw; }
.lp-telop { font-family: "lp-maru", sans-serif; font-size: 6.2cqw; -webkit-text-stroke-width: 1.5cqw; }
.lp-tx.look-yellow { color: #ffe600; }
.lp-tx.look-tsukkomi {
  color: #ff2d2d; -webkit-text-stroke-color: #fff;
  filter: drop-shadow(.4cqw 0 0 #000) drop-shadow(-.4cqw 0 0 #000) drop-shadow(0 .4cqw 0 #000) drop-shadow(0 -.4cqw 0 #000);
}
/* コメントの枠（白い吹き出し。timeline.js の COMMENT_LOOK.bubble） */
.lp-comment {
  font-family: "lp-maru", sans-serif; font-size: 5cqw; color: #1a1a1a; -webkit-text-stroke: 0;
  background: #fff; border: .5cqw solid #1a1a1a; border-radius: 3cqw; padding: 1.8cqw 4.4cqw;
}
.lp-comment::after {
  content: ""; position: absolute; left: 20%; bottom: -2.4cqw; width: 3.6cqw; height: 3.6cqw; background: #fff;
  border-right: .4cqw solid #1a1a1a; border-bottom: .4cqw solid #1a1a1a; transform: rotate(45deg) skew(8deg, 8deg);
}

/* できること・使う流れ・料金 */
.lp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.lp-card h3 { margin: 0 0 6px; font-size: 1rem; }
.lp-card p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.lp-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lp-steps li {
  counter-increment: step; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.lp-steps img { width: 100%; height: auto; border-radius: 8px; margin-bottom: 8px; display: block; box-shadow: var(--frame); }
.lp-steps img[hidden] { display: none; }
.lp-steps b { display: flex; align-items: center; gap: 8px; }
.lp-steps b::before {
  content: counter(step); flex: none; display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%;
  background: var(--marker); color: var(--marker-ink); border: 1.5px solid var(--ink); font-size: .85rem;
}
.lp-steps span { color: var(--ink-2); font-size: .9rem; }
.lp-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.lp-plan { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.lp-price { font-size: 1.4rem; font-weight: 700; }
.lp-price small { font-size: .8rem; font-weight: 400; color: var(--ink-2); }
.lp-plan-note { grid-column: 1 / -1; margin: 0; }
.lp-foot {
  max-width: 1120px; margin: 48px auto 8px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 20px;
}
.lp-foot .lp-notice { flex-basis: 100%; margin: 4px 0 0; }
@media (max-width: 720px) {
  .lp-hero { padding: 28px 0 8px; }
  .lp-hero .providers { max-width: none; }
  .lp-section { margin-top: 32px; }
}

/* ---- 初めての人への画面ごとのヒント（2026-10-24。hints.js） */
.hintbar {
  display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; padding: 10px 12px 10px 14px;
  border: 1px solid color-mix(in srgb, var(--marker) 70%, var(--line)); border-radius: 8px;
  background: color-mix(in srgb, var(--marker) 16%, var(--surface));
}
.hintbar p { flex: 1; margin: 0; font-size: .9rem; color: var(--ink); min-width: 0; }
.hintbar-icon { flex: none; line-height: 1.6; }
.hintbar-ok { flex: none; padding: 3px 12px; font-size: .85rem; }
.hintbar-x { flex: none; padding: 0 8px; border: none; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1.4; }
.hintbar-x:hover:not(:disabled) { color: var(--ink); }
@media (max-width: 640px) { .hintbar { flex-wrap: wrap; } .hintbar p { flex-basis: calc(100% - 60px); } }

/* ---- 分析の前の確認（URL を入れて「分析を始める」を押したとき） */
.confirm {
  display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; padding: 14px;
  border: 1px solid var(--accent); border-radius: 10px; background: var(--page);
}
.confirm[hidden], #confirm[hidden] { display: none; }
.confirm-thumb { width: 320px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--line); display: block; }
.confirm-text { flex: 1 1 280px; min-width: 0; }
.confirm-q { margin: 0 0 6px; font-size: .85rem; font-weight: 600; color: var(--accent); }
.confirm-title { font-size: 1.15rem; margin: 6px 0; line-height: 1.4; overflow-wrap: anywhere; }
.confirm-note { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--error); color: var(--ink-2); font-size: .9rem; }
/* YouTube の取り込みアプリ（app.js の helperNote・helperLaunched・showHelperInstall） */
.helper-note .button, .helper-note button { margin-top: 6px; }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.helper-launched { border-color: var(--accent); }
.helper-launched button.link { margin-top: 4px; font-weight: 400; }
.confirm .actions { margin-top: 12px; }
.confirm .small { margin: 8px 0 0; }
#checking[hidden] { display: none; }

/* チャンネルのアイコンと名前 */
.channel { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.channel:hover span { text-decoration: underline; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line); display: block; }

/* ---- 結果の画面の見出し（チャンネルのヘッダー画像を背に） */
.vod-hero { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); margin-bottom: 8px; }
.vod-banner { height: 120px; background-size: cover; background-position: center; position: relative; }
.vod-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(0 0 0 / 0) 40%, var(--surface)); }
.vod-banner-empty { height: 56px; background: linear-gradient(120deg, color-mix(in srgb, var(--marker) 45%, var(--surface)), var(--surface)); }
.vod-hero-body { position: relative; display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; padding: 0 20px 18px; margin-top: -64px; }
.vod-banner-empty + .vod-hero-body { margin-top: -28px; }
.vod-hero .thumb-lg { box-shadow: 0 4px 18px rgb(0 0 0 / .45); border: 1px solid var(--line); display: block; background: var(--line); }
.vod-hero-text { flex: 1 1 320px; min-width: 0; }
.vod-hero-text h1 { margin: 6px 0 10px; overflow-wrap: anywhere; }
.vod-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: .9rem; }
.vod-facts div { min-width: 0; }
.vod-facts dt { font-size: .75rem; color: var(--muted); }
.vod-facts dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- 候補の「#」の横の、いちばん盛り上がった瞬間の静止画 */
.rank-cell { display: flex; gap: 10px; align-items: flex-start; }
.rank-num { display: flex; flex-direction: column; gap: 2px; min-width: 40px; }
.rank-num b { font-size: 1.05rem; }
.peak { position: relative; display: block; flex: none; line-height: 0; border-radius: 6px; overflow: hidden; }
.peak-img { width: 144px; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--line); }
.peak-time {
  position: absolute; right: 4px; bottom: 4px; padding: 1px 6px; border-radius: 4px; line-height: 1.5;
  font-size: .72rem; color: #fff; background: rgb(0 0 0 / .72); font-variant-numeric: tabular-nums;
}
.peak:hover .peak-img { outline: 2px solid var(--accent); outline-offset: -2px; }

@media (max-width: 640px) {
  main { padding: 12px 16px; }
  .card { padding: 12px; }
  .c-rank { width: 200px; }
  .peak-img { width: 120px; }
  .vod-hero-body { padding: 0 14px 14px; }
}

/* ---- 初回のおためし（stage2/lp-trial.md。2026-10-31）：LP の URL の欄・確認、管理者の集計 */
/* URL の欄はヒーローの主役（2026-11-08）：切り取り線の点線で囲んだ大きな欄、マーカー色のボタン。
   点線はゆっくり流れ、角にハサミ。動きを減らす設定の人には止める */
.lp-url { max-width: 640px; margin: 0 auto 20px; text-align: left; }
.lp-url-box {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px;
  border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--marker) 45%, transparent); animation: lp-url-glow 2.8s ease-out infinite;
  transition: background-color .2s;
}
.lp-url-cut { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; color: var(--ink); }
.lp-url-cut rect { animation: lp-url-march 1.1s linear infinite; }
.lp-url-scissors { position: absolute; top: -16px; left: 26px; width: 46px; height: 31px; color: var(--ink); pointer-events: none; }
.lp-url-scissors svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lp-url-scissors svg [fill="var(--page)"] { fill: var(--surface); }
.lp-url-box:focus-within { background: var(--field); animation: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker) 55%, transparent); }
.lp-url-box:focus-within .lp-url-cut { color: var(--marker); }
.lp-url-box input {
  flex: 1 1 auto; min-width: 0; padding: 14px 4px; font-size: 1.08rem; border: none; background: transparent; color: var(--ink);
}
.lp-url-box input:focus { outline: none; }
.lp-url-box input::placeholder { color: var(--muted); opacity: .8; }
.lp-url-go {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; font-size: 1.02rem; font-weight: 700;
  border-radius: 12px; background: var(--marker); color: var(--marker-ink); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.lp-url-go:hover:not(:disabled) { border-color: var(--ink); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.lp-url-go:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.lp-url-go svg { transition: transform .15s; }
.lp-url-go:hover:not(:disabled) svg { transform: translateX(3px); }
.lp-url-note { margin: 10px 0 0; }
@keyframes lp-url-march { to { stroke-dashoffset: -15; } }
@keyframes lp-url-glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--marker) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--marker) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .lp-url-box, .lp-url-cut rect { animation: none; }
}
/* スマホの幅では、欄とボタンを縦に並べる（入力の文字は 16px 以上にして、iPhone で勝手に拡大されないようにする） */
@media (max-width: 560px) {
  .lp-url-box { flex-direction: column; align-items: stretch; padding: 12px; }
  .lp-url-box input { padding: 12px 6px; font-size: 1rem; }
  .lp-url-go { justify-content: center; }
}
#lp-checking[hidden] { display: none; }
/* URL を確かめた結果の窓（2026-11-08）。中は分析の前の確認と同じ形。狭い画面ではサムネイルが上に来る */
.lp-confirm-top { display: flex; align-items: baseline; gap: 12px; }
.lp-confirm-top h2 { flex: 1; margin: 0; }
.lp-confirm-dialog .lp-confirm { margin-top: 12px; border: none; padding: 0; background: transparent; }
.lp-confirm .confirm-thumb { width: 260px; }
@media (max-width: 640px) { .lp-confirm .confirm-thumb { width: 100%; } }
.lp-confirm .google-btn, .lp-hero .lp-login .google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 18px; font-weight: 700;
  background: var(--ink); color: var(--page); border: 1px solid var(--ink); border-radius: 999px;
}
.lp-confirm .google-btn .google-g { background: #fff; border-radius: 50%; padding: 4px; width: 26px; height: 26px; }
.lp-hero .providers.lp-login { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; max-width: none; margin-top: 30px; gap: 10px 12px; }
.lp-hero .providers.lp-login button { padding: 6px 14px; font-weight: 500; }
.lp-hero .lp-login .google-btn { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.lp-hero .lp-login .google-btn .google-g { width: 18px; height: 18px; padding: 0; }

table.funnel { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.funnel th, table.funnel td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.funnel td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel-bar { width: 30%; }
.funnel-bar span { display: block; height: 10px; border-radius: 5px; background: var(--marker); min-width: 2px; }

/* 鍵の付いた候補（初回のおためしの 3 位より下）：静止画の代わりに鍵の印 */

/* VOD のページの「候補一覧」「書き出し一覧」のタブ（2026-11-08） */
.vod-tabs-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.vod-tabs-row .vod-tabs { border-bottom: none; margin: 0 0 -1px; flex: 1; }
.vod-tabs-row .vod-tabs button { font-size: 1rem; padding: 8px 14px; }
.vod-tabs-row .actions { margin: 0 0 8px; }
.vod-tabs-row .actions[hidden], #panel-cands[hidden], #panel-shorts[hidden] { display: none; }
.tab-count { font-size: .8rem; color: var(--muted); font-weight: 400; }
/* 取り込みアプリ：つないでいる PC の一覧（#/helper） */
.helper-devices { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.helper-devices li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.helper-devices li button { margin-left: auto; }
.helper-link .actions { margin-top: 12px; }
