/* 配信番組サイト（/show/）— POP なベントー配置。黒背景・彩度の高い単色の角丸カード・極太の見出し・丸いシール風バッジ。
   色はすべて :root のトークン。ジャンル色の文字色（-ink）は WCAG AA（4.5:1 以上）を確認済み:
   赤 #e02a1b/白 4.65・青 #1f5fe0/白 5.57・濃ピンク #e0157a/白 4.61・紫 #7b2ff2/白 5.95・
   緑 #23c25b/黒 8.0・クリーム #fff1d0/黒 16.8・グレー #b8b8b8/黒 9.5・白/黒 18.9 */

:root {
  --bg: #0b0b0d;
  --surface: #17171b;
  --surface-2: #232329;
  --line: #3a3a44;
  --text: #ffffff;
  --text-2: #d4d4dc;
  --muted: #a9a9b4;
  --ink: #111111;

  --g-main: #e02a1b;    --g-main-ink: #ffffff;
  --g-host: #1f5fe0;    --g-host-ink: #ffffff;
  --g-kyaba: #e0157a;   --g-kyaba-ink: #ffffff;
  --g-kabuki: #7b2ff2;  --g-kabuki-ink: #ffffff;
  --g-night: #23c25b;   --g-night-ink: #111111;
  --g-general: #fff1d0; --g-general-ink: #111111;
  --g-review: #b8b8b8;  --g-review-ink: #111111;
  --g-white: #ffffff;   --g-white-ink: #111111;

  --yellow: #ffd60a;
  --ok: #23c25b;
  --warn: #ffd60a;
  --over: #ff5a4e;
  --under: #5ea0ff;

  --radius: 26px;
  --radius-sm: 16px;
  --tap: 44px;
  --font-head: var(--font-body);
  --font-body: system-ui, -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  overflow-wrap: anywhere;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 6px var(--ink); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--g-white); color: var(--ink); padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; }
.wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* 見出し: 読みやすいゴシックの太字（端末の標準フォント）。POP さは色・角丸カード・シールで出す */
.sec-title, .tile-head, .tile-kicker, .slot-name, .tcard-name, .live-headline, .live-kicker, .corner-title h3,
.sh-brand, .side-title, .item-name, .slot-no, .dlg-head h2 {
  font-family: var(--font-head); font-weight: 700; letter-spacing: .01em;
}
/* 映す用の大見出しは 800 まで */
.oa-headline, .oa-title-main, .oa-card-name, .oa-pill, .oa-list, .oa-num-v { font-family: var(--font-head); font-weight: 800; letter-spacing: .01em; }

/* ジャンル色 */
.g-main { background: var(--g-main); color: var(--g-main-ink); }
.g-host { background: var(--g-host); color: var(--g-host-ink); }
.g-kyaba { background: var(--g-kyaba); color: var(--g-kyaba-ink); }
.g-kabuki { background: var(--g-kabuki); color: var(--g-kabuki-ink); }
.g-night { background: var(--g-night); color: var(--g-night-ink); }
.g-general { background: var(--g-general); color: var(--g-general-ink); }
.g-review { background: var(--g-review); color: var(--g-review-ink); }
.g-white { background: var(--g-white); color: var(--g-white-ink); }
.g-main-edge { --edge: var(--g-main); }
.g-host-edge { --edge: var(--g-host); }
.g-kyaba-edge { --edge: var(--g-kyaba); }
.g-kabuki-edge { --edge: var(--g-kabuki); }
.g-night-edge { --edge: var(--g-night); }
.g-general-edge { --edge: var(--g-general); }
.g-review-edge { --edge: var(--g-review); }
.g-white-edge { --edge: var(--g-white); }

.icon { width: 1.1em; height: 1.1em; flex: none; display: inline-block; vertical-align: -0.15em; }

/* ---------------------------------------------------------------- 部品 */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 8px 18px; border-radius: 999px;
  border: 2px solid var(--g-white); background: var(--g-white); color: var(--ink);
  font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn-icon { min-width: var(--tap); padding: 6px 10px; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost, .btn-ghost-dark { background: transparent; border-color: currentColor; color: inherit; }
.btn-red { background: var(--g-main); border-color: var(--g-main); color: #fff; }
.btn-onred { background: #fff; border-color: #fff; color: var(--ink); }
.btn-start { background: var(--yellow); border-color: var(--ink); color: var(--ink); font-size: 18px; min-height: 52px; padding: 10px 24px; box-shadow: 4px 4px 0 var(--ink); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.input {
  width: 100%; min-height: var(--tap); padding: 8px 12px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface-2); color: var(--text);
}
textarea.input { resize: vertical; line-height: 1.55; }
.input-sm { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.input:focus-visible { border-color: var(--yellow); }
.tile .input, .slot .input, .tcard .input { background: #fff; color: var(--ink); border-color: var(--ink); }
.field { display: grid; gap: 4px; min-width: 0; margin-top: 10px; }
.field-label { font-weight: 800; font-size: 14px; }
.hint { font-weight: 400; margin-left: 6px; font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; background: var(--ink); color: #fff; border: 2px solid var(--ink); white-space: nowrap;
}
.badge-new { background: var(--yellow); color: var(--ink); transform: rotate(-4deg); }
.badge-carry { background: #fff; color: var(--ink); }
.badge-me { background: var(--ink); color: #fff; }
.badge-bm { background: var(--yellow); color: var(--ink); }
.badge-used { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.badge-suggest { background: #fff; color: var(--ink); border-style: dashed; }

/* 丸いシール風バッジ */
.sticker {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; min-height: 34px;
  border-radius: 999px; border: 3px solid var(--ink); font-weight: 800; font-size: 13px; box-shadow: 2px 2px 0 var(--ink);
  white-space: nowrap; flex: none;
}
.sticker .icon { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--ink); color: #fff; }
.sticker.is-small { min-height: 30px; font-size: 12px; }
.sticker.is-small .icon { width: 20px; height: 20px; padding: 3px; }

.state-box { margin: 60px auto; max-width: 560px; text-align: center; padding: 28px 20px; color: var(--text-2); }
.state-error h2 { font-size: 20px; margin-bottom: 8px; }
.empty { padding: 18px; border: 2px dashed var(--line); border-radius: var(--radius-sm); color: var(--text-2); text-align: center; }

.sample-banner { background: var(--yellow); color: var(--ink); padding: 8px 16px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* ---------------------------------------------------------------- ヘッダー */

.sh-header { border-bottom: 3px solid var(--surface-2); padding-bottom: 10px; }
.sh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; }
.sh-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.sh-brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--g-main); color: #fff; font-size: 18px; }
.page-tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-2); gap: 2px; flex: none; }
.page-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 16px; border-radius: 999px; text-decoration: none; font-weight: 800; color: var(--text-2); }
.page-tabs a[aria-current="page"] { background: var(--g-white); color: var(--ink); }
.page-tabs a:hover:not([aria-current]) { color: var(--text); }
.sh-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 10px; }
.screen-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.screen-tabs a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 6px 18px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; text-decoration: none;
  background: var(--surface-2); color: var(--text); border: 2px solid transparent;
}
.screen-tabs a[aria-current="page"] { background: var(--g-main); color: #fff; border-color: #fff; }
.screen-tabs a[data-route="onair"]::after { content: "↗"; margin-left: 4px; font-family: var(--font-body); }
.week-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.week-label { font-weight: 800; font-size: 14px; }
.week-box select { width: auto; max-width: 100%; }
.week-range { color: var(--text-2); font-size: 13px; }
.sh-meta { margin-left: auto; font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.save-status[data-kind="ok"] { color: var(--muted); }
.save-status[data-kind="warn"] { color: var(--warn); }
.save-status[data-kind="error"] { color: #ff8a80; font-weight: 700; }

main { padding: 18px 0 40px; }
#view:focus { outline: none; }

/* ---------------------------------------------------------------- 編成 */

.tile { border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.tile-kicker { font-size: 24px; line-height: 1.25; }
.tile-head { font-size: 20px; line-height: 1.3; }
.tile-sub { font-size: 14px; margin-top: 4px; }
.bento-head { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.title-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 0 12px; }
.input-title { font-weight: 800; }
.cp-status { font-size: 14px; margin-top: 10px; font-weight: 600; }
.import-msg { margin-top: 8px; font-weight: 700; font-size: 14px; }
.import-msg.is-error { background: var(--ink); color: #ff8a80; padding: 6px 10px; border-radius: 10px; }

.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.sec-title { font-size: 26px; line-height: 1.25; }
.sec-note { font-size: 14px; color: var(--text-2); }
.sec-note.is-warn { color: var(--warn); font-weight: 700; }
.card .sec-note { color: var(--text-2); }
.sub-title { font-size: 15px; font-weight: 800; margin: 14px 0 6px; }

.main-slots { margin-top: 24px; }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.slot { position: relative; border-radius: var(--radius); padding: 20px 22px 18px; min-height: 230px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.slot.is-empty { border: 3px dashed var(--g-main); color: var(--text); background: transparent; }
.slot-no {
  position: absolute; top: -10px; right: -6px; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-size: 26px; background: var(--g-white); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(8deg);
}
.slot-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-right: 50px; }
.slot-name { font-size: 28px; line-height: 1.25; }
.slot-lead { font-size: 14px; }
.slot .row { margin-top: auto; padding-top: 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; }
.stats b { font-size: 16px; }
.stats-lg { font-size: 15px; }
.stats-lg b { font-size: 20px; }

.plan-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; margin-top: 28px; align-items: start; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; min-width: 0; }

.corner-list { display: grid; gap: 12px; }
.corner { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; border-left: 10px solid var(--edge, var(--line)); }
.corner-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.corner-chip { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--ink); }
.corner-chip .icon { width: 22px; height: 22px; }
.corner-title h3 { font-size: 18px; line-height: 1.3; }
.corner-sub { font-size: 13px; color: var(--text-2); }
.min-box { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.input-min { width: 76px; text-align: right; }
.corner-empty { margin-top: 8px; font-size: 14px; }
.corner-auto { margin-top: 8px; font-size: 14px; color: var(--text-2); }
.corner-auto b { color: var(--text); }
.item-list { display: grid; gap: 8px; margin-top: 10px; }
.item { background: var(--surface); border-radius: 14px; padding: 8px 10px; border-left: 6px solid var(--edge, var(--line)); }
.item.is-missing { display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--text-2); }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.item-no { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--g-white); color: var(--ink); font-weight: 800; font-size: 14px; }
.item-name { font-size: 16px; line-height: 1.3; flex: 1; min-width: 0; }
.item-btns { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.script { margin-top: 6px; }
.script summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 700; color: var(--text-2); }
.review-sum { margin-top: 8px; font-size: 14px; }
.hit-list { display: grid; gap: 4px; margin-top: 4px; }

.cand-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cand-tools .input { width: 220px; max-width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer; font-size: 14px;
}
.chip[aria-pressed="true"] { background: var(--g-white); color: var(--ink); border-color: var(--g-white); }
.chip-host[aria-pressed="true"] { background: var(--g-host); color: var(--g-host-ink); border-color: #fff; }
.chip-kyaba[aria-pressed="true"] { background: var(--g-kyaba); color: var(--g-kyaba-ink); border-color: #fff; }
.chip-kabuki[aria-pressed="true"] { background: var(--g-kabuki); color: var(--g-kabuki-ink); border-color: #fff; }
.chip-night[aria-pressed="true"] { background: var(--g-night); color: var(--g-night-ink); border-color: #fff; }
.chip-general[aria-pressed="true"] { background: var(--g-general); color: var(--g-general-ink); border-color: #fff; }
.cand-count { font-size: 13px; margin: 10px 0; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.tcard { border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tcard-marks { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.tcard-name { font-size: 20px; line-height: 1.3; }
.tcard-text { font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: pre-wrap; }
.tcard-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; padding-top: 4px; }
.in-corner { font-weight: 800; font-size: 13px; }
.suggest-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; padding: 8px; border: 2px dashed currentColor; border-radius: 14px; }
.more-row { display: flex; justify-content: center; margin-top: 14px; }

.plan-extra { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.plan-extra .dict { grid-column: 1 / -1; }
.mini-list { display: grid; gap: 6px; margin-top: 8px; }
.mini-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 12px; padding: 6px 10px; }
.mini-text { flex: 1; min-width: 0; font-size: 14px; }
.plan-extra .bookmarks-sec { grid-column: 1 / -1; }
.bm-list li.is-used { opacity: .75; }
.bm-in { font-size: 13px; font-weight: 700; color: var(--text-2); }
.bm-when { font-size: 12px; }
.dict-head, .dict-row { display: grid; grid-template-columns: 28px minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 2fr) minmax(0, 1.5fr) auto auto; gap: 8px; align-items: center; }
.dict-head { font-size: 13px; color: var(--text-2); font-weight: 700; margin-top: 10px; }
.dict-list { display: grid; gap: 8px; margin-top: 6px; }
.dict-night { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.dict-night input { width: 20px; height: 20px; accent-color: var(--g-main); }
.singles { margin-top: 18px; background: var(--surface); border-radius: var(--radius); padding: 6px 16px 16px; }
.singles > summary { cursor: pointer; min-height: var(--tap); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-weight: 800; font-size: 17px; }
.singles > summary .muted { font-weight: 400; font-size: 13px; }
.tcard.is-compact { padding: 12px 14px; gap: 6px; }
.tcard.is-compact .tcard-name { font-size: 16px; }
.dict-no { font-weight: 800; color: var(--text-2); text-align: center; }

/* 投稿カード */
.post { background: #fff; color: var(--ink); border-radius: 18px; padding: 12px 14px; display: grid; gap: 6px; min-width: 0; margin-top: 8px; }
.post.is-compact { padding: 10px 12px; }
.post.is-compact .post-text { -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.post-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.post-user { font-weight: 800; }
.post-time { color: #4a4a4a; }
.post-text { white-space: pre-wrap; font-size: 14px; }
.post-text.muted { color: #4a4a4a; }
.post-id { font-size: 12px; color: #4a4a4a; }
.post-img { width: 100%; max-width: 320px; height: auto; max-height: 220px; object-fit: cover; border-radius: 12px; background: #eee; }
.post-img-ph { font-size: 12px; color: #4a4a4a; }
.metrics { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; }
.metric-k { color: #4a4a4a; margin-right: 4px; }
.metric-v { font-weight: 800; }
.post-bm { font-size: 12px; font-weight: 700; color: #4a4a4a; }
.post-pace { font-size: 12px; color: #4a4a4a; }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.post-actions .btn-ghost { color: var(--ink); }
.post-move { margin-left: auto; }
.post-move select { width: auto; max-width: 240px; }
.embed-host { min-height: 60px; }
.embed-skeleton { font-size: 13px; color: var(--text-2); padding: 8px 0; }

/* 話題の編集ダイアログ */
.topic-dialog { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); }
.topic-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dlg-body { padding: 0 20px 20px; }
.dlg-head { display: flex; align-items: center; gap: 10px; margin: 0 -20px 12px; padding: 16px 20px; border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0; z-index: 2; }
.dlg-head h2 { font-size: 22px; line-height: 1.3; flex: 1; min-width: 0; }
.dlg-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 12px; }
.dlg-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.dlg-sub { font-size: 17px; font-weight: 800; margin-top: 18px; }

/* ---------------------------------------------------------------- 進行 */

.live { width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 16px 120px; }
.live-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px 24px; align-items: center; border-radius: var(--radius); padding: 18px 24px; }
.live-corner { display: flex; align-items: center; gap: 14px; min-width: 0; }
.live-icon { width: 64px; height: 64px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; border: 3px solid currentColor; }
.live-icon .icon { width: 34px; height: 34px; }
.live-kicker { font-size: 34px; line-height: 1.15; }
.live-count { white-space: nowrap; margin-left: .6em; }
.live-sub { font-size: 15px; font-weight: 700; }
.live-timer { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.tm { display: grid; line-height: 1.1; }
.tm-k { font-size: 12px; font-weight: 800; }
.tm-v { font-family: var(--font-head); font-weight: 800; font-size: 34px; font-variant-numeric: tabular-nums; }
.tm-v.is-over { text-decoration: underline wavy; }
.tm-s { font-size: 13px; font-weight: 700; }
.drift { padding: 6px 14px; border-radius: 999px; font-weight: 800; border: 3px solid var(--ink); background: #fff; color: var(--ink); white-space: nowrap; }
.drift.is-over { background: var(--ink); color: #ff8a80; border-color: #ff8a80; }
.drift.is-under { background: var(--ink); color: #9cc4ff; border-color: #9cc4ff; }
.drift.is-ok { background: #fff; color: var(--ink); }
.drift.is-idle { background: transparent; color: inherit; border-color: currentColor; }
.live-start { justify-self: end; }
.live-start .btn-ghost-dark { color: inherit; }

.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-top: 16px; align-items: start; }
.live-main { position: relative; background: var(--surface); border-radius: var(--radius); padding: 22px 26px; min-height: 420px; overflow: hidden; }
.live-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.live-headline { font-size: 46px; line-height: 1.2; margin-top: 10px; }
.live-kicker-dark { font-weight: 800; color: var(--text-2); }
.live-lead { font-size: 20px; line-height: 1.6; margin-top: 12px; font-weight: 600; }
.live-two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; margin-top: 16px; }
.live-two.is-single { grid-template-columns: minmax(0, 720px); }
.live-h3 { font-size: 15px; font-weight: 800; margin-top: 14px; color: var(--text-2); }
.live-notes { background: var(--g-general); color: var(--ink); border-radius: 20px; padding: 14px 16px; margin-top: 14px; }
.live-notes h3 { font-size: 14px; font-weight: 800; }
.live-notes h3 + p { margin-bottom: 8px; font-size: 17px; }
.big-list { display: grid; gap: 8px; margin-top: 8px; font-size: 22px; font-weight: 800; list-style: decimal inside; }

.live-side { background: var(--surface); border-radius: var(--radius); padding: 16px; position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow: auto; }
.side-title { font-size: 18px; margin-bottom: 8px; }
.prog { display: grid; gap: 4px; }
.prog-item {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; min-height: var(--tap);
  background: transparent; border: 2px solid transparent; border-radius: 12px; padding: 4px 8px; cursor: pointer; color: var(--text);
}
.prog-item:hover { background: var(--surface-2); }
.prog-item.is-current { border-color: #fff; background: var(--surface-2); }
.prog-item.is-done .prog-text, .prog-item.is-skipped .prog-text, .prog-item.is-carried .prog-text { color: var(--muted); text-decoration: line-through; }
.prog-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; border: 2px solid var(--ink); }
.prog-item.is-done .prog-dot { background: var(--g-main); color: #fff; transform: rotate(-12deg); }
.prog-item.is-skipped .prog-dot, .prog-item.is-carried .prog-dot { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.prog-text { font-size: 14px; line-height: 1.35; min-width: 0; }

.live-controls {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr 1fr 2fr; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(11, 11, 13, .94); border-top: 3px solid var(--surface-2);
}
.ctl { min-height: 64px; font-size: 20px; font-family: var(--font-head); font-weight: 700; border-width: 3px; }
.ctl kbd { font-family: var(--font-body); font-size: 12px; padding: 1px 6px; border-radius: 6px; border: 2px solid currentColor; margin-left: 8px; vertical-align: 2px; }
.ctl-back { background: var(--surface-2); color: #fff; border-color: #fff; }
.ctl-skip { background: var(--g-review); color: var(--ink); border-color: var(--ink); }
.ctl-carry { background: var(--g-kabuki); color: #fff; border-color: #fff; }
.ctl-done { background: var(--g-main); color: #fff; border-color: #fff; font-size: 26px; }
.ctl:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); border-color: var(--line); }

/* 済スタンプ */
.stamp {
  position: absolute; top: 18px; right: 24px; width: 150px; height: 150px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 70px;
  color: var(--g-main); border: 8px double var(--g-main); background: rgba(255, 255, 255, .92); transform: rotate(-14deg); pointer-events: none;
}
.stamp.is-anim { animation: stamp-pop .9s ease-out forwards; }
@keyframes stamp-pop {
  0% { transform: rotate(-14deg) scale(2.2); opacity: 0; }
  25% { transform: rotate(-14deg) scale(.92); opacity: 1; }
  35% { transform: rotate(-14deg) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------------------------------------------------------------- 振り返り */

.review-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.review-list { display: grid; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 600; }
.review-list li { line-height: 1.5; }
.review-list .dot { display: inline-block; margin-right: 6px; vertical-align: -1px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid var(--ink); }
.export { margin-top: 18px; }
.export-text { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; }

/* ---------------------------------------------------------------- 映す用（1920×1080） */

body[data-route="onair"] .sh-header, body[data-route="onair"] .sample-banner, body[data-route="onair"] .skip-link { display: none !important; }
body[data-route="onair"] main { padding: 0; }
body[data-route="onair"] { overflow: hidden; }
.oa-viewport { position: fixed; inset: 0; background: #000; overflow: hidden; }
.oa-stage {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; margin: -540px 0 0 -960px; transform-origin: center center;
  background: var(--bg); color: #fff; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; padding: 48px 64px 40px; gap: 28px;
}
.oa-top { display: flex; align-items: center; gap: 18px; }
.oa-pill { display: inline-flex; align-items: center; gap: 12px; padding: 10px 28px; border-radius: 999px; font-size: 34px; border: 4px solid var(--ink); box-shadow: 4px 4px 0 #000; }
.oa-pill .icon { width: 36px; height: 36px; }
.oa-pill-show { background: #fff; color: var(--ink); }
.oa-sample { background: var(--yellow); color: var(--ink); font-size: 24px; }
.oa-date { margin-left: auto; font-size: 30px; font-weight: 800; color: var(--text-2); }
.oa-body { min-height: 0; position: relative; }
.oa-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; height: 100%; }
.oa-news { border-radius: 56px; padding: 56px 60px; display: flex; flex-direction: column; gap: 28px; min-height: 0; }
.oa-news .sticker { font-size: 26px; min-height: 56px; border-width: 4px; padding-right: 22px; }
.oa-news .sticker .icon { width: 42px; height: 42px; padding: 7px; }
.oa-headline { font-size: 104px; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.oa-nums { display: flex; gap: 20px; margin-top: auto; flex-wrap: wrap; }
.oa-num { background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 32px; padding: 14px 28px; display: grid; box-shadow: 5px 5px 0 var(--ink); }
.oa-num-k { font-size: 24px; font-weight: 800; }
.oa-num-v { font-family: var(--font-head); font-weight: 700; font-size: 56px; line-height: 1.1; }
.oa-post { background: #fff; color: var(--ink); border-radius: 48px; padding: 44px 48px; display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow: hidden; }
.oa-post.is-empty { display: grid; place-items: center; font-size: 40px; font-weight: 800; }
.oa-post-head { display: flex; gap: 18px; align-items: baseline; font-size: 28px; }
.oa-post-user { font-weight: 800; }
.oa-post-text { font-size: 38px; line-height: 1.5; white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; }
.oa-post-img { max-width: 100%; max-height: 300px; object-fit: cover; border-radius: 24px; align-self: flex-start; }
.oa-post .metrics { font-size: 26px; gap: 6px 26px; margin-top: auto; }
.oa-title { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; }
.oa-title-sub { font-size: 44px; font-weight: 800; }
.oa-title-main { font-size: 110px; line-height: 1.15; }
.oa-title-main.is-small { font-size: 72px; }
.oa-title .oa-title-main { font-size: 88px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.oa-title-sub { background: var(--g-main); color: #fff; padding: 8px 28px; border-radius: 999px; border: 4px solid #fff; transform: rotate(-2deg); }
.oa-big-icon .icon { width: 140px; height: 140px; }
.oa-list-wrap { display: flex; flex-direction: column; gap: 28px; height: 100%; justify-content: center; }
.oa-list-head { font-size: 40px; font-weight: 800; color: var(--yellow); }
.oa-list { display: grid; gap: 22px; }
.oa-list li { display: flex; align-items: center; gap: 28px; font-size: 64px; line-height: 1.2; padding: 22px 36px; border-radius: 40px; }
.oa-no { width: 84px; height: 84px; flex: none; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; border: 4px solid var(--ink); font-size: 48px; }
.oa-hits { display: grid; gap: 18px; }
.oa-hits li { display: flex; justify-content: space-between; gap: 24px; font-size: 40px; background: var(--g-review); color: var(--ink); border-radius: 32px; padding: 20px 36px; font-weight: 800; }
.oa-foot { display: flex; gap: 12px; flex-wrap: wrap; }
.oa-step { padding: 8px 22px; border-radius: 999px; font-size: 24px; font-weight: 800; background: var(--surface-2); color: var(--text-2); }
.oa-step.is-current { background: #fff; color: var(--ink); }
.oa-card { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; pointer-events: none; }
.oa-card-icon .icon { width: 180px; height: 180px; }
.oa-card-name { font-size: 160px; line-height: 1.1; text-align: center; }
.oa-card-sub { font-size: 48px; font-weight: 800; }
.oa-card.is-anim { animation: oa-card 2.6s ease-in-out forwards; }
@keyframes oa-card {
  0% { transform: translateY(100%); }
  14% { transform: translateY(0); }
  84% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-6%); opacity: 0; }
}

/* ---------------------------------------------------------------- レスポンシブ */

@media (max-width: 1180px) {
  .bento-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bento-head .tile-title { grid-column: 1 / -1; }
  .plan-cols { grid-template-columns: minmax(0, 1fr); }
  .live-grid { grid-template-columns: minmax(0, 1fr); }
  .live-side { position: static; max-height: none; }
  .review-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .wrap { padding-left: 12px; padding-right: 12px; }
  .sh-top { flex-wrap: wrap; }
  .sh-brand { font-size: 15px; }
  .screen-tabs a { padding: 6px 14px; }
  .sh-meta { margin-left: 0; }
  .bento-head, .slot-grid, .plan-extra, .review-cols { grid-template-columns: minmax(0, 1fr); }
  .title-grid, .dlg-grid { grid-template-columns: minmax(0, 1fr); }
  .tile { padding: 16px; }
  .tile-kicker { font-size: 20px; }
  .sec-title { font-size: 22px; }
  .slot { min-height: 0; }
  .slot-name { font-size: 22px; }
  .cand-grid { grid-template-columns: minmax(0, 1fr); }
  .dict-head { display: none; }
  .dict-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); padding: 8px; background: var(--surface-2); border-radius: 12px; }
  .dict-row > :nth-child(4), .dict-row > :nth-child(5) { grid-column: 2 / -1; }
  .dict-row > .dict-night { grid-column: 2; }
  .dict-row > :last-child { grid-column: 3; justify-self: start; }
  .live { padding: 0 12px 170px; }
  .live-bar { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .live-start { justify-self: start; }
  .live-kicker { font-size: 24px; }
  .live-icon { width: 48px; height: 48px; }
  .tm-v { font-size: 26px; }
  .live-main { padding: 16px; min-height: 0; }
  .live-headline { font-size: 30px; }
  .live-lead { font-size: 16px; }
  .live-two { grid-template-columns: minmax(0, 1fr); }
  .live-controls { grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .ctl { min-height: 52px; font-size: 16px; }
  .ctl-done { font-size: 18px; }
  .ctl kbd { display: none; }
  .stamp { width: 110px; height: 110px; font-size: 50px; }
  .dlg-row { grid-template-columns: minmax(0, 1fr); }
  .mini-list .mini-text { flex: 1 1 100%; }
  .post-move { margin-left: 0; width: 100%; }
  .post-move select { max-width: 100%; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:hover:not(:disabled), .btn:active:not(:disabled) { transform: none; }
}

/* ---------------------------------------------------------------- X 埋め込み（候補・ブックマーク・進行・映す用） */
.embed-host { position: relative; min-width: 0; }
/* 読み込みが終わるまで埋め込みは隠し、データの内容（embed-skeleton）を見せる。失敗したらそのまま残る */
.embed-host:not(.is-loaded) .embed-target { position: absolute; left: -10000px; top: 0; width: 550px; }
.embed-host.is-loaded .embed-target { display: flex; justify-content: center; }
.embed-host .embed-target > * { margin: 0 !important; max-width: 100%; }
.embed-failed-note { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.embed-fallback .post { margin-top: 0; }

.view-toggle { margin-left: auto; color: var(--text); }
.cand-grid.is-embed { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.tcard.is-embed { background: var(--surface); padding: 0; overflow: hidden; gap: 0; color: var(--text); border: 3px solid var(--surface-2); }
.tcard-band { padding: 12px 14px 10px; display: grid; gap: 6px; border-radius: 0 0 18px 18px; }
.tcard-band .stats { font-size: 13px; }
.tcard-body { padding: 10px 10px 0; min-height: 120px; }
.tcard.is-embed .suggest-row { margin: 10px 10px 0; }
.tcard.is-embed .tcard-actions { padding: 10px; }
.tcard.is-embed .btn-dark { background: var(--g-white); border-color: var(--g-white); color: var(--ink); }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; align-items: start; }
.bm-card { background: var(--surface-2); border-radius: 22px; overflow: hidden; border: 3px solid var(--yellow); }
.bm-card.is-used { border-color: var(--line); }
.bm-band { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; background: var(--yellow); color: var(--ink); }
.bm-card.is-used .bm-band { background: var(--g-review); }
.bm-star { font-size: 18px; }
.bm-user { flex: 1; min-width: 0; }
.bm-card .tcard-actions { padding: 10px; }
.live-embed .embed-target { justify-content: flex-start !important; }
.warn-note { background: var(--yellow); color: var(--ink); font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 12px; margin-top: 8px; }
.slot.is-bad { outline: 4px dashed var(--yellow); outline-offset: -4px; }
.oa-post-wrap { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.oa-post-wrap .embed-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.oa-post-wrap .embed-skeleton { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.oa-post-wrap .embed-skeleton > .oa-post { flex: 1; }
.oa-embed.is-loaded { align-items: center; justify-content: center; background: #fff; border-radius: 48px; padding: 24px; }
.oa-embed.is-loaded .embed-target { transform: scale(1.45); transform-origin: top center; }
.oa-embed .embed-failed-note { display: none; }

/* ---------------------------------------------------------------- 整理（片付け・削除）とトースト */
.tidy-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.btn-danger { border-style: dashed; }
.cand-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; border-bottom: 3px solid var(--surface-2); }
.cand-tab { min-height: var(--tap); padding: 6px 16px; border: 0; border-radius: 14px 14px 0 0; background: transparent; color: var(--text-2); font-weight: 800; cursor: pointer; }
.cand-tab.is-active { background: var(--g-white); color: var(--ink); }
.tidy-list .mini-list { margin-top: 10px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 24px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-radius: 18px;
  background: var(--g-white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-weight: 700;
}
.toast .toast-undo { background: var(--ink); border-color: var(--ink); color: #fff; }
body[data-route="live"] .toast { bottom: 110px; }
body[data-route="onair"] .toast { display: none !important; }

/* ---------------------------------------------------------------- 話題の候補（2026-10-16 改定: 候補が主役・構成は右のサイドパネル） */
.plan.wrap { max-width: 1760px; }
.plan-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.plan-cols.is-side-closed { grid-template-columns: minmax(0, 1fr) 64px; }
.side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding: 18px 16px; }
.side .sec-head { align-items: center; }
.side .sec-title { font-size: 22px; }
.side-toggle { margin-left: auto; }
.side.is-closed { padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 10px; overflow: visible; }
.side.is-closed .side-toggle { writing-mode: vertical-rl; min-height: 150px; padding: 12px 6px; margin: 0; }
.side-mini { display: grid; gap: 4px; text-align: center; font-size: 12px; color: var(--text-2); }
.side-mini b { font-size: 16px; color: var(--text); }

.cand-grid.is-embed { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 24px; align-items: start; }
.cand-grid.is-embed > .tcard { width: 100%; max-width: 460px; }
.tcard.is-embed { background: var(--surface); border: 2px solid var(--line); border-radius: 24px; padding: 0; gap: 0; overflow: visible; color: var(--text); }
.tcard.is-embed .tcard-band { border-radius: 22px 22px 0 0; padding: 14px 16px 12px; display: grid; gap: 6px; cursor: pointer; border-bottom: 4px solid var(--ink); }
.tcard-top { align-items: center; }
.tcard-marks .badge { border-radius: 999px; box-shadow: 2px 2px 0 var(--ink); }
.tcard-name { font-size: 20px; line-height: 1.35; margin: 0; }
.tcard-open { all: unset; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tcard-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.tcard-open:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; box-shadow: 0 0 0 6px var(--ink); border-radius: 4px; }
.tcard-stats { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tcard.is-embed .tcard-body { padding: 14px 14px 4px; min-height: 120px; }
.tcard.is-datacard .tcard-body { min-height: 0; }
.tcard.is-datacard .tcard-body .post { margin-top: 0; }
.tcard.is-embed .suggest-row { margin: 8px 14px 0; }
.tcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--line); margin-top: 10px; }
.in-corner-box { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.in-corner-box .in-corner { color: var(--yellow); }

/* 長い投稿は高さで切って「全体を見る」 */
.embed-host.is-clamp { max-height: 520px; overflow: hidden; }
.embed-host.is-clamp.is-open { max-height: none; }
.embed-expand {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; min-height: var(--tap); border: 0; cursor: pointer; font-weight: 800; color: var(--text);
  background: linear-gradient(to bottom, rgba(23, 23, 27, 0), rgba(23, 23, 27, .96) 45%);
  padding-top: 24px;
}
.embed-host.is-open .embed-expand { position: static; background: transparent; padding-top: 0; }

/* メニュー（番組に入れる ▾ / …） */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-put > summary { background: var(--g-white); color: var(--ink); border-color: var(--g-white); }
.menu-more { margin-left: auto; }
.menu-more > summary { min-width: var(--tap); background: transparent; color: var(--text); border-color: var(--line); font-size: 18px; line-height: 1; }
.menu-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 240px; display: grid; gap: 2px; padding: 6px;
  background: var(--surface-2); border: 2px solid var(--g-white); border-radius: 14px; box-shadow: 4px 4px 0 #000;
}
.menu-more .menu-list { left: auto; right: 0; }
.menu-item { all: unset; box-sizing: border-box; display: block; min-height: var(--tap); padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--text); font-weight: 700; font-size: 14px; }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--g-white); color: var(--ink); }
.menu-item:disabled { color: var(--muted); cursor: not-allowed; }
.menu-item.is-danger { color: #ff9b93; }
.menu-item.is-danger:hover { background: #ff9b93; color: var(--ink); }
.menu-note { font-size: 12px; color: var(--muted); padding: 6px 12px; }

/* 単発投稿の一覧 */
.single-list { display: grid; gap: 8px; margin-top: 10px; }
.srow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 16px; padding: 10px 12px; }
.srow-main { min-width: 0; display: grid; gap: 2px; }
.srow-open { all: unset; cursor: pointer; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-open:hover { text-decoration: underline; }
.srow-open:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }
.srow-sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-main .badge { justify-self: start; }
.srow-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }

/* 1件ずつ見る詳細ビュー */
.detail-dialog { width: min(780px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--text); overflow: auto; }
.detail-dialog::backdrop { background: rgba(0, 0, 0, .75); }
.detail-head { position: sticky; top: 0; z-index: 5; padding: 16px 20px 14px; display: grid; gap: 6px; border-bottom: 4px solid var(--ink); }
.detail-title-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.detail-title { font-size: 24px; line-height: 1.3; }
.detail-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-nav .btn-dark:disabled { opacity: .5; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.detail-actions .suggest-row { flex-basis: 100%; }
.detail-posts { display: grid; gap: 24px; padding: 18px 20px 28px; }
.detail-post { display: grid; gap: 8px; justify-items: stretch; padding-bottom: 20px; border-bottom: 1px dashed var(--line); }
.detail-post:last-child { border-bottom: 0; }
.detail-post-no { font-size: 13px; font-weight: 800; color: var(--text-2); }
.detail-post .embed-host { max-width: 560px; width: 100%; justify-self: center; }
.detail-post-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

@media (max-width: 1180px) {
  .plan-cols, .plan-cols.is-side-closed { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; overflow: visible; }
  .side.is-closed { flex-direction: row; justify-content: space-between; padding: 10px 14px; }
  .side.is-closed .side-toggle { writing-mode: horizontal-tb; min-height: var(--tap); }
  .side-mini { grid-auto-flow: column; gap: 10px; align-items: baseline; }
}
@media (max-width: 760px) {
  .cand-grid.is-embed { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .srow { grid-template-columns: auto minmax(0, 1fr); }
  .srow-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .menu-list { min-width: 220px; }
  .menu-put .menu-list { left: 0; }
  .detail-title { font-size: 20px; }
  .detail-head, .detail-actions, .detail-posts { padding-left: 14px; padding-right: 14px; }
}

/* ================================================================ 編成（フォルダ型・v2 段階1）
   基準は画面半分（960×1040）。1400px 以上は ツリー｜一覧｜プレビュー の 3 列。760px 以下はツリーを引き出しに。 */
body[data-route="plan"] main, body[data-route="plan-folders"] main { padding: 0; }
body[data-route="plan"] .sh-header, body[data-route="plan-folders"] .sh-header { padding-bottom: 6px; }
.plan2 { display: flex; flex-direction: column; height: calc(100dvh - var(--hdr, 120px)); min-height: 520px; padding: 8px 12px 0; gap: 8px; }
.plan-top { display: grid; gap: 6px; }
.pt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.pt-title { font-size: 18px; white-space: nowrap; }
.pt-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.pt-titlebox { flex: 1 1 260px; min-width: 0; }
.pt-titlebox .input { width: 100%; }
.plan-search { flex: 1 1 280px; min-width: 0; min-height: 40px; }
.pt-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pt-tools .btn:disabled { opacity: .4; }
.tree-drawer-btn { display: none; }
.menu-cp .menu-list { left: auto; right: 0; min-width: 260px; }

.plan2-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; }
/* 3 列（木・一覧・プレビュー）は 1400px 以上だけ。幅が変わったときは描き直して切り替える（show.js） */
@media (min-width: 1400px) { .plan2.is-wide .plan2-body { grid-template-columns: 300px minmax(0, 1fr) minmax(460px, 600px); } }
.plan2:not(.is-wide) .preview-pane { grid-column: 2; grid-row: 1; }
.list-pane.is-hidden { display: none; }

/* フォルダの木 */
.tree-pane { min-height: 0; overflow: auto; background: var(--surface); border-radius: 18px; padding: 8px 6px 12px; }
.tree-list { display: grid; gap: 1px; grid-template-columns: minmax(0, 1fr); }
.tree-head { font-size: 12px; font-weight: 800; color: var(--muted); padding: 10px 10px 4px; letter-spacing: .04em; }
.tree-node { display: flex; align-items: center; gap: 2px; border-radius: 10px; border: 2px solid transparent; min-width: 0; }
.tree-node.depth-1 { padding-left: 4px; }
.tree-node.depth-2 { padding-left: 22px; }
.tree-node.is-active { background: var(--surface-2); border-color: var(--g-white); }
.tree-node.is-drop-ok { border-color: var(--line); border-style: dashed; }
.tree-node.is-drop-over { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.tree-node.is-drop-over .tree-sub, .tree-node.is-drop-over .tree-count { color: var(--ink); }
.tree-toggle { all: unset; width: 24px; min-height: 36px; text-align: center; cursor: pointer; color: var(--text-2); flex: none; }
.tree-toggle:focus-visible { outline: 3px solid var(--yellow); border-radius: 6px; }
.tree-toggle-sp { width: 24px; flex: none; }
.tree-label { all: unset; box-sizing: border-box; flex: 1; min-width: 0; min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 4px 8px; cursor: pointer; border-radius: 8px; font-size: 14px; }
.tree-label:hover { background: var(--surface-2); }
.tree-label:focus-visible { outline: 3px solid var(--yellow); outline-offset: -2px; }
.tree-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px solid rgba(255,255,255,.5); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tree-node.depth-2 .tree-name { font-weight: 600; }
.tree-sub { margin-left: 6px; font-weight: 400; color: var(--text-2); font-size: 12px; }
.tree-count { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; flex: none; }

/* 一覧 */
.list-pane { min-height: 0; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; overflow: hidden; position: relative; }
.lp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.lp-title { font-size: 17px; min-width: 0; overflow-wrap: anywhere; }
.lp-count { font-size: 13px; color: var(--text-2); font-weight: 400; margin-left: 8px; }
.lp-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-note { font-size: 13px; color: var(--text-2); padding: 8px 12px 0; }
.lp-corner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.lp-corner textarea { flex: 1 1 200px; min-height: 40px; }
.lp-empty { margin: 12px; }
.lp-empty.is-drop-ok { border-color: var(--g-white); }
.lp-empty.is-drop-over { background: var(--yellow); color: var(--ink); }
.vlist { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; outline: none; }
.vlist:focus-visible { box-shadow: inset 0 0 0 3px var(--yellow); }
.vlist-inner { position: relative; }
.row-item {
  position: absolute; left: 0; right: 0; height: 56px; display: grid; grid-template-columns: 18px 26px 6px minmax(0, 1fr) 40px; align-items: center; gap: 6px;
  padding: 0 6px 0 4px; border-bottom: 1px solid var(--surface-2); cursor: default; user-select: none; touch-action: pan-y;
}
.row-item:hover { background: rgba(255, 255, 255, .04); }
.row-item.is-selected { background: #2b2a3a; }
.row-item.is-focus { box-shadow: inset 3px 0 0 var(--yellow); }
.row-item.is-drop-ok { outline: 2px dashed var(--line); outline-offset: -3px; }
.row-item.is-drop-over { background: var(--yellow); color: var(--ink); }
.row-item.is-drop-over .row-meta { color: var(--ink); }
.drag-handle { color: var(--muted); font-size: 12px; letter-spacing: -3px; cursor: grab; touch-action: none; white-space: nowrap; overflow: hidden; height: 100%; display: flex; align-items: center; justify-content: center; }
.row-check { width: 20px; height: 20px; accent-color: var(--g-main); cursor: pointer; }
.row-color { width: 6px; height: 36px; border-radius: 3px; }
.row-main { min-width: 0; display: grid; gap: 2px; }
.row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.row-title.is-topic { font-weight: 800; }
.row-title.is-topic::before { content: ""; display: inline-block; width: 12px; height: 9px; margin-right: 6px; border: 2px solid currentColor; border-radius: 2px 2px 3px 3px; vertical-align: 0; }
.row-meta { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.row-meta > * { flex: none; }
.rm-user { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.rm-imp { font-variant-numeric: tabular-nums; }
.rm-star { color: var(--yellow); }
.rm-topic { color: var(--text); max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.rm-place { background: var(--g-main); color: #fff; border-radius: 6px; padding: 0 6px; font-weight: 800; }
.rm-new { background: var(--yellow); color: var(--ink); border-radius: 6px; padding: 0 6px; font-weight: 800; }
.rm-tag, .rm-kind { border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.rm-suggest { border: 1px dashed var(--text-2); border-radius: 6px; padding: 0 5px; }
.row-more { all: unset; box-sizing: border-box; width: 40px; height: 40px; border-radius: 10px; text-align: center; line-height: 38px; cursor: pointer; font-size: 18px; color: var(--text-2); }
.row-more:hover, .row-more:focus-visible { background: var(--surface-2); color: var(--text); }

/* 一括操作バー */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; background: var(--g-white); color: var(--ink); border-top: 3px solid var(--ink); }
.bulk-bar .btn { border-color: var(--ink); }
.bulk-bar .btn-ghost { color: var(--ink); }
.bulk-count { margin-right: 4px; }
.menu-up .menu-list { top: auto; bottom: calc(100% + 6px); }
.bulk-bar .menu-btn { background: var(--ink); color: #fff; border-color: var(--ink); }

/* プレビュー */
.preview-pane { min-height: 0; overflow: auto; background: var(--surface); border-radius: 18px; padding: 8px 12px 16px; }
.pv-top { position: sticky; top: -8px; z-index: 3; background: var(--surface); padding: 2px 0 6px; }
.plan2.is-wide .pv-back { display: none; }
.pv-empty { color: var(--text-2); padding: 12px 4px; }
.pv-help { list-style: disc; padding-left: 20px; margin-top: 8px; display: grid; gap: 4px; font-size: 14px; }
.pv-body { display: grid; gap: 10px; }
.pv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; }
.pv-title { font-size: 18px; overflow-wrap: anywhere; }
.pv-link { all: unset; cursor: pointer; text-decoration: underline; font-weight: 700; }
.pv-post { max-width: 560px; }
.pv-post .post { margin-top: 0; }
.pv-actions { display: grid; gap: 8px; }
.pv-actions .field { max-width: 260px; }
.pv-sub { font-size: 14px; color: var(--text-2); }
.pv-script summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }

/* ドラッグ */
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; display: flex; align-items: center; gap: 8px; max-width: 320px; padding: 8px 12px; border-radius: 14px; background: var(--g-white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 #000; font-weight: 700; font-size: 13px; }
.drag-ghost.is-over { background: var(--yellow); }
.drag-count { background: var(--g-main); color: #fff; border-radius: 999px; padding: 2px 8px; font-weight: 900; flex: none; }
.drag-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }

/* 右クリックメニュー */
.ctx-menu { position: fixed; z-index: 90; min-width: 240px; max-width: min(320px, calc(100vw - 8px)); max-height: calc(100vh - 16px); overflow: auto; display: grid; gap: 1px; padding: 6px; background: var(--surface-2); border: 2px solid var(--g-white); border-radius: 14px; box-shadow: 4px 4px 0 #000; }
.ctx-heading { font-size: 11px; font-weight: 800; color: var(--muted); padding: 6px 10px 2px; }
.ctx-sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.ctx-item { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; }
.ctx-item:hover:not(:disabled), .ctx-item:focus-visible { background: var(--g-white); color: var(--ink); }
.ctx-item:disabled { color: var(--muted); cursor: not-allowed; }
.ctx-item.is-danger { color: #ff9b93; }
.ctx-item.is-danger:hover, .ctx-item.is-danger:focus-visible { background: #ff9b93; color: var(--ink); }
.ctx-item kbd { font-size: 11px; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .8; }

/* 移動先・名前・ツールのダイアログ */
.move-dialog, .name-dialog, .tools-dialog { border: 0; border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
.move-dialog::backdrop, .name-dialog::backdrop, .tools-dialog::backdrop, .sort-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.move-dialog { display: flex; flex-direction: column; }
.move-dialog[open] { display: flex; }
.move-head, .tools-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.move-head h2, .tools-head h2 { font-size: 18px; }
.move-dialog > .input { margin: 10px 16px 0; width: auto; }
.move-list { overflow: auto; padding: 6px 12px 14px; display: grid; gap: 2px; min-height: 0; }
.move-group { font-size: 12px; font-weight: 800; color: var(--muted); padding: 10px 4px 2px; }
.move-item { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border-left: 6px solid var(--edge, var(--line)); background: var(--surface-2); }
.move-item:hover:not(:disabled), .move-item:focus-visible { background: var(--g-white); color: var(--ink); }
.move-item:disabled { opacity: .45; cursor: not-allowed; }
.move-label { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-sub { font-size: 12px; color: inherit; opacity: .8; flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-dialog { padding: 16px 18px; }
.name-title { font-size: 18px; }
.tools-dialog { width: min(820px, calc(100vw - 24px)); overflow: auto; }
.tools-body { padding: 4px 18px 20px; display: grid; gap: 18px; }
.tools-sec h3 { font-size: 16px; margin-bottom: 6px; }

/* 仕分けモード */
.sort-dialog { border: 0; padding: 0; width: min(760px, calc(100vw - 16px)); height: min(980px, calc(100vh - 16px)); max-height: calc(100vh - 16px); border-radius: 20px; background: var(--surface); color: var(--text); }
.sort-dialog[open] { display: flex; flex-direction: column; }
.sort-head { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sort-head h2 { font-size: 18px; }
.sort-src { font-size: 13px; color: var(--text-2); font-weight: 400; }
.sort-prog { font-weight: 800; font-variant-numeric: tabular-nums; }
.sort-bar { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.sort-bar > span { display: block; height: 100%; background: var(--g-night); }
.sort-head .btn { grid-column: 2; grid-row: 1 / span 2; }
.sort-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; display: grid; gap: 10px; align-content: start; }
.sort-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; }
.sort-item-title { font-size: 18px; overflow-wrap: anywhere; }
.sort-meta { font-size: 13px; }
.sort-post { max-width: 560px; justify-self: center; width: 100%; }
.sort-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 12px 6px; border-top: 1px solid var(--line); }
.sort-key { min-height: 48px; font-size: 15px; }
.sort-key kbd { font-size: 12px; border: 2px solid currentColor; border-radius: 6px; padding: 0 6px; }
.k-main { background: var(--g-main); color: #fff; border-color: var(--g-main); }
.k-cat { background: var(--g-kabuki); color: #fff; border-color: var(--g-kabuki); }
.k-chat { background: var(--g-general); color: var(--ink); border-color: var(--g-general); }
.k-genre { background: var(--g-host); color: #fff; border-color: var(--g-host); }
.k-x { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.k-prev, .k-next { background: transparent; color: var(--text); border-color: var(--line); }
.sort-genres { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 12px 12px; }
.sort-genres .chip.is-on { background: var(--g-white); color: var(--ink); }
.sort-end { display: grid; gap: 8px; padding: 30px 10px; text-align: center; justify-items: center; }

/* 960px 未満: 一覧とプレビューは切替（3 列は 1400px 以上だけ） */
@media (max-width: 1100px) {
  .plan2-body { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .plan2 { height: auto; min-height: 0; padding: 6px 8px 0; }
  .tree-drawer-btn { display: inline-flex; }
  .plan2-body { grid-template-columns: minmax(0, 1fr); }
  .plan2 .tree-pane { display: none; }
  .plan2.is-drawer .tree-pane { display: block; position: fixed; inset: 0 30% 0 0; z-index: 70; border-radius: 0 18px 18px 0; box-shadow: 8px 0 0 rgba(0,0,0,.6); padding-top: 12px; }
  .plan2:not(.is-wide) .preview-pane { grid-column: 1; }
  .list-pane { height: calc(100dvh - var(--hdr, 120px) - 150px); min-height: 420px; }
  .preview-pane { min-height: 60vh; }
  .pt-title { font-size: 16px; }
  .row-item { grid-template-columns: 22px 24px 5px minmax(0, 1fr) 36px; }
  .sort-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sort-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}

/* ================================================================ 進行（画面半分向け・縦 1 列。全画面では右に一覧） */
.live2 { max-width: 1600px; margin: 0 auto; padding: 8px 12px 120px; display: grid; gap: 10px; }
.lv-progress { display: flex; align-items: center; gap: 3px; overflow-x: auto; padding: 4px 2px; scrollbar-width: thin; }
.lvp-corner { flex: none; font-size: 11px; font-weight: 800; color: var(--text-2); margin: 0 4px 0 8px; white-space: nowrap; }
.lvp-corner:first-child { margin-left: 0; }
.lvp-seg { all: unset; box-sizing: border-box; flex: 1 1 22px; min-width: 14px; height: 10px; border-radius: 5px; opacity: .45; cursor: pointer; border: 2px solid transparent; }
.lvp-seg.is-done { opacity: .95; }
.lvp-seg.is-skipped, .lvp-seg.is-carried { opacity: .6; background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(0,0,0,.45) 4px 7px); }
.lvp-seg.is-current { opacity: 1; height: 16px; border-color: #fff; }
.lvp-seg:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.lvp-count { flex: none; font-size: 12px; color: var(--text-2); margin-left: 8px; white-space: nowrap; }
.live-head { border-radius: 20px; padding: 12px 16px 14px; display: grid; gap: 6px; }
.lh-corner { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.live-head .live-icon { width: 32px; height: 32px; border-width: 2px; }
.live-head .live-icon .icon { width: 18px; height: 18px; }
.lh-title { font-size: clamp(24px, 3.6vw, 40px); line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.lh-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.lh-row .live-start { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-self: auto; }
.lh-row .live-start .btn-ghost-dark { color: inherit; }
.live2 .tm-v { font-size: 26px; }
.live2 .live-grid { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.live2 .live-side { display: none; }
.live2 .live-main { min-height: 0; padding: 14px 16px; }
.live2 .live-tags { align-items: center; }
.live2 .live-tags .stats { margin-left: 4px; }
.live2 .live-lead { font-size: 18px; margin-top: 8px; }
.live2 .live-two { grid-template-columns: minmax(0, 1fr); }
.live2 .live-embed, .live2 .live-two .post { max-width: 560px; }
@media (min-width: 1400px) {
  .live2 .live-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .live2 .live-side { display: block; }
}
@media (max-width: 760px) {
  .live2 { padding: 6px 8px 170px; }
  .lh-title { font-size: 24px; }
  .live2 .live-lead { font-size: 16px; }
}
.lvp-seg.g-main { background-color: var(--g-main); }
.lvp-seg.g-host { background-color: var(--g-host); }
.lvp-seg.g-kyaba { background-color: var(--g-kyaba); }
.lvp-seg.g-kabuki { background-color: var(--g-kabuki); }
.lvp-seg.g-night { background-color: var(--g-night); }
.lvp-seg.g-general { background-color: var(--g-general); }
.lvp-seg.g-review { background-color: var(--g-review); }
.lvp-seg.g-white { background-color: var(--g-white); }
.oa-split.is-nocard { grid-template-columns: minmax(0, 1fr); }

/* ================================================================ 段階2: OBS 連動（状態ピル・接続ダイアログ・セットアップガイド） */
.obs-pill { all: unset; box-sizing: border-box; cursor: pointer; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.obs-pill[hidden] { display: none; }
.obs-pill:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.obs-pill[data-state="connected"] { background: var(--ok); border-color: var(--ok); color: var(--ink); }
.obs-pill[data-state="connecting"] { background: var(--warn); border-color: var(--warn); color: var(--ink); }
.obs-pill[data-state="error"] { background: #5a1410; border-color: var(--over); color: #fff; }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--g-main); }

.obs-dialog { border: 0; border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; }
.obs-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.obs-body { padding: 4px 16px 16px; }
.obs-body > p { margin-top: 10px; font-size: 14px; }
.obs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 0 10px; }
.obs-state { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.obs-state.is-connected { border-color: var(--ok); }
.obs-state.is-connecting { border-color: var(--warn); }
.obs-state.is-error { border-color: var(--over); background: #2c1110; }
.obs-reason { display: block; margin-top: 4px; color: var(--text-2); font-weight: 400; }
.obs-warn { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: #2b2610; border: 1px solid var(--warn); color: var(--text); font-size: 13px; }
.obs-help { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.obs-help summary { cursor: pointer; font-weight: 800; color: var(--text); }
.obs-help ul { margin: 6px 0 0 18px; display: grid; gap: 4px; }

.obs-setup { padding-top: 16px; padding-bottom: 40px; max-width: 1100px; }
.obs-setup .sec-head { align-items: center; }
.setup-steps { margin: 0 0 8px 20px; display: grid; gap: 8px; font-size: 15px; line-height: 1.6; }
.setup-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.setup-part { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.setup-part h3 { font-size: 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.setup-part > p { font-size: 13px; margin-top: 4px; }
.setup-size { font-size: 13px; color: var(--yellow); font-weight: 800; }
.setup-url { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.setup-url .input { flex: 1 1 100%; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.obs-setup code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.setup-fig { margin: 0; }
.setup-canvas { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #26262e; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.setup-box { position: absolute; box-sizing: border-box; border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px; font-size: clamp(9px, 1.2vw, 13px); font-weight: 800; line-height: 1.25; overflow: hidden; }
.setup-box.is-other { background: rgba(255, 255, 255, .08); border: 1px dashed #8a8a96; color: var(--text-2); }
.setup-box.is-ours { border: 2px solid #fff; color: #fff; z-index: 1; }
.setup-box.part-card { background: rgba(31, 95, 224, .75); }
.setup-box.part-topicbar { background: rgba(224, 42, 27, .8); }
.setup-box.part-comments { background: rgba(35, 194, 91, .28); border-style: dashed; z-index: 0; align-items: flex-end; }
.setup-box.part-pin { background: rgba(255, 60, 110, .55); border-color: #ff3c6e; z-index: 1; }
.setup-fig figcaption { margin-top: 6px; font-size: 13px; }

/* ================================================================ 段階3: Grok ボット連携（印・雑談おすすめ・修正の書き戻し） */
.badge-bot { background: #0f0f12; color: #fff; border-color: #fff; letter-spacing: .02em; }
.badge-check { background: var(--warn); color: var(--ink); border-color: var(--warn); }
.badge.is-small { font-size: 11px; padding: 0 6px; min-height: 0; line-height: 18px; }
.tree-bot { flex: none; font-size: 10px; font-weight: 800; line-height: 16px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--text-2); color: var(--text); }
.tree-bot.is-low { background: var(--warn); border-color: var(--warn); color: var(--ink); }
.rm-pick { color: #9fe7b4; max-width: 22em; overflow: hidden; text-overflow: ellipsis; }
.pick-note { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #12301c; border: 1px solid var(--ok); font-size: 14px; }
.bot-check { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #2b2610; border: 1px solid var(--warn); font-size: 14px; }
.lead-mark { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 20px; vertical-align: 2px; background: #0f0f12; color: #fff; border: 1px solid #fff; }
.lead-mark-line { margin-top: 4px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lead-mark-line .lead-mark { margin-left: 0; }
.fb-counts { font-weight: 800; margin-top: 8px; }
.gh-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.gh-box > summary { cursor: pointer; font-weight: 800; }
.gh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 10px; }
.gh-box .obs-help ol { margin: 6px 0 0 18px; display: grid; gap: 4px; }
.fb-link { margin-left: 8px; color: inherit; text-decoration: underline; }

/* ================================================================ 段階4: 演出パレット（進行画面。折りたたみ式・画面半分でも 1〜2 行） */
.fx-palette { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 8px; min-width: 0; }
.fxp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.fxp-toggle { min-height: 30px; padding: 2px 12px; }
.fxp-hint { font-size: 12px; color: var(--muted); }
.fxp-status { margin-left: auto; font-size: 12px; color: var(--text-2); }
.fxp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0 4px; }
.fxp-btn { min-height: 36px; padding: 2px 10px; background: var(--surface-2); color: var(--text); border-color: var(--line); gap: 4px; }
.fxp-btn kbd { font-size: 10px; margin-left: 4px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--muted); color: var(--muted); font-family: inherit; }
.fxp-icon { margin-right: 4px; }
.fxp-btn.is-fired { animation: fxp-fired .6s ease-out; }
@keyframes fxp-fired { from { background: var(--yellow); color: var(--ink); } to { background: var(--surface-2); } }
.fxp-thanks { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.fxp-name { width: 9em; }
.fxp-amount { width: 7em; }
@media (prefers-reduced-motion: reduce) { .fxp-btn.is-fired { animation: none; outline: 2px solid var(--yellow); } }

/* ---------------- 進行: YouTube ライブのコメント（パネル・一覧・設定） */
/* 進行の 1 行のバー */
.yc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 8px; min-width: 0; margin-top: 6px; }
.ycb-label { font-weight: 800; font-size: 13px; flex: none; }
.yc-bar .ycp-status { flex: 1 1 160px; }
.ycp-status { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ycp-status[data-state="running"] { color: var(--ok); font-weight: 800; }
.ycp-status[data-state="error"] { color: #ff8a80; font-weight: 800; }
.ycp-status[data-state="retrying"] { color: var(--warn); }
.ycp-run { min-height: 30px; padding: 2px 14px; flex: none; }
.ycp-run.is-on { background: var(--ink); color: #fff; border-color: var(--over); }
.ycp-url { flex: 1 1 280px; min-width: 0; }
.ycp-flow { margin: 0; white-space: nowrap; }
.yc-pinned { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; padding: 6px 8px; border: 2px solid #ff3c6e; border-radius: 12px; background: #2a1219; min-width: 0; }
.yc-pin-tag { flex: none; font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 999px; background: #ff3c6e; color: #fff; }
.yc-pinned-text { flex: 1 1 auto; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yc-log { list-style: none; margin: 0 0 4px; padding: 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
.yc-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.yc-row.is-pinned { background: #2a1219; box-shadow: inset 4px 0 0 #ff3c6e; }
.yc-row.is-ng, .yc-row.is-hidden { opacity: .5; }
.yc-row.is-ng .yc-text { text-decoration: line-through; }
.yc-icon { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.yc-initial { display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: #3c3c48; }
.yc-body { min-width: 0; }
.yc-line1 { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.yc-name { font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.yc-badge { flex: none; font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 999px; border: 1px solid var(--muted); color: var(--text-2); }
.yc-badge.is-owner { border-color: var(--yellow); color: var(--yellow); }
.yc-badge.is-mod { border-color: var(--under); color: var(--under); }
.yc-badge.is-ng { border-color: #ff8a80; color: #ff8a80; }
.yc-badge.is-pin { border-color: #ff3c6e; background: #ff3c6e; color: #fff; }
.yc-text { margin: 1px 0 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.yc-amount { display: inline-block; font-size: 12px; font-weight: 900; padding: 0 8px; margin-right: 6px; border-radius: 999px; background: var(--yellow); color: var(--ink); }
.yc-acts { display: flex; gap: 4px; flex: none; }
.yc-btn { min-height: 30px; padding: 2px 10px; font-size: 12px; }
.yc-btn.is-on { background: #ff3c6e; border-color: #ff3c6e; color: #fff; }
.yc-empty { padding: 10px 4px; font-size: 13px; }
.yc-dialog { width: min(640px, calc(100vw - 24px)); }
.yc-h3 { margin: 14px 0 0; font-size: 15px; }
.yc-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.yc-quota { margin: 6px 0 0; font-size: 13px; }
.ycp-hint { margin: 0 0 4px; font-size: 12px; }
.ycp-found { margin: 0 0 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ycp-found b { color: var(--ok); margin-right: 4px; }

/* ---------------- レイアウト調整（流れる範囲・固定コメント。1920×1080 の縮図） */
/* ---------------- ［コメント］ページ（上のバー・一覧・レイアウト） */
.cmp { padding: 0 12px 24px; }
.cmp-bar { position: sticky; top: 0; z-index: 15; background: var(--bg); padding: 6px 0 6px; display: grid; gap: 4px; box-shadow: 0 6px 12px -8px rgba(0, 0, 0, .8); }
.cmp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.cmp-title { margin: 0; font-size: 18px; flex: none; }
.cmp-bar .ycp-status { flex: 1 1 200px; font-size: 14px; }
.cmp-bar .ycp-url { flex: 1 1 320px; }
.cmp-bar .ycp-hint { margin: 0; }
.cmp-role { margin-left: 8px; color: var(--warn); font-weight: 700; }
.cmp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.cmp-log-col { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; min-width: 0; display: flex; flex-direction: column; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.yc-chip { min-height: 34px; font-size: 13px; }
.yc-chip.is-on { background: var(--g-white); color: var(--ink); border-color: var(--g-white); }
.cmp .yc-log.cmp-log { max-height: none; height: 45vh; min-height: 240px; }
.cmp .yc-row { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 8px 4px; gap: 10px; }
.cmp .yc-icon { width: 40px; height: 40px; }
.cmp .yc-name { font-size: 13px; }
.cmp .yc-text { font-size: 17px; line-height: 1.4; -webkit-line-clamp: 3; }
.cmp .yc-btn { min-height: 38px; padding: 4px 12px; font-size: 13px; }
.cmp .yc-pinned { padding: 8px 10px; }
.cmp .yc-pinned-text { font-size: 15px; }
.cmp-layout-col { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
@media (min-width: 1200px) {
  .cmp-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); align-items: start; }
  .cmp .yc-log.cmp-log { height: calc(100vh - var(--hdr, 160px) - 190px); min-height: 360px; }
}
.le-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px 6px; border-bottom: 1px solid var(--line); }
.le-head h2 { margin: 0; font-size: 17px; flex: 1 1 auto; min-width: 0; }
.le-saved { font-size: 12px; color: var(--muted); width: 100%; }
.le-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.le-sub { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.le-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.le-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 14px; }
.le-seg { display: inline-flex; gap: 0; }
.le-sel { border-radius: 0; background: var(--surface-2); color: var(--text); border-color: var(--line); }
.le-sel:first-child { border-radius: 999px 0 0 999px; }
.le-sel:last-child { border-radius: 0 999px 999px 0; }
.le-sel[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: #fff; }
.le-check { margin: 0; font-size: 13px; }
.le-msg { font-size: 12px; color: var(--text-2); }
.le-wrap { position: relative; margin: 0 14px; overflow: hidden; border-radius: 10px; background: repeating-conic-gradient(#20222b 0% 25%, #1a1b22 0% 50%) 0 0 / 24px 24px; border: 1px solid var(--line); }
.le-stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; --le-inv: 2; }
.le-bg { position: absolute; inset: 0; width: 1920px; height: 1080px; object-fit: fill; opacity: .85; pointer-events: none; }
.le-refs { position: absolute; inset: 0; pointer-events: none; }
.le-ref { position: absolute; display: grid; place-items: center; border: 4px dashed rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .75); font-size: 30px; font-weight: 800; text-align: center; border-radius: 10px; }
.le-ref.is-ours { border-color: rgba(120, 170, 255, .45); color: rgba(170, 200, 255, .85); }
.le-frame { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; background: transparent; pointer-events: none; color-scheme: dark; }
.le-obj { position: absolute; box-sizing: border-box; cursor: move; outline: none; touch-action: none; }
.le-band { border: calc(3px * var(--le-inv)) solid #23c25b; background: rgba(35, 194, 91, .10); }
.le-pin { border: calc(3px * var(--le-inv)) solid #ff3c6e; background: rgba(255, 60, 110, .08); }
.le-obj.is-sel { box-shadow: 0 0 0 calc(3px * var(--le-inv)) var(--yellow); }
.le-obj:focus-visible { box-shadow: 0 0 0 calc(4px * var(--le-inv)) var(--yellow); }
.le-lanes { position: absolute; inset: 0; pointer-events: none; }
.le-lane { position: absolute; left: 0; right: 0; border-top: calc(2px * var(--le-inv)) dashed rgba(35, 194, 91, .7); }
.le-label { position: absolute; left: 0; bottom: 100%; margin-bottom: calc(4px * var(--le-inv)); padding: calc(2px * var(--le-inv)) calc(8px * var(--le-inv)); border-radius: calc(6px * var(--le-inv)); font-size: calc(12px * var(--le-inv)); font-weight: 800; white-space: nowrap; background: #23c25b; color: #111; pointer-events: none; }
.le-pin .le-label { left: auto; right: 0; background: #ff3c6e; color: #fff; }
.le-h { position: absolute; width: calc(16px * var(--le-inv)); height: calc(16px * var(--le-inv)); margin: calc(-8px * var(--le-inv)) 0 0 calc(-8px * var(--le-inv)); background: #fff; border: calc(2px * var(--le-inv)) solid #111; border-radius: 50%; touch-action: none; z-index: 2; }
.le-h::after { content: ''; position: absolute; inset: calc(-8px * var(--le-inv)); } /* 触りやすく（見た目より大きく） */
.le-h-nw { left: 0; top: 0; cursor: nwse-resize; }
.le-h-n { left: 50%; top: 0; cursor: ns-resize; }
.le-h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.le-h-e { left: 100%; top: 50%; cursor: ew-resize; }
.le-h-se { left: 100%; top: 100%; cursor: nwse-resize; }
.le-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.le-h-sw { left: 0; top: 100%; cursor: nesw-resize; }
.le-h-w { left: 0; top: 50%; cursor: ew-resize; }
.le-stage.is-dragging { cursor: grabbing; }
.le-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; padding: 10px 14px 14px; }
.le-box { border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px 10px; margin: 0; min-width: 0; }
.le-box legend { font-weight: 800; padding: 0 6px; }
.le-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; }
.le-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.le-num { width: 5.5em; }
.le-slider input[type="range"] { width: 130px; }
.le-out { min-width: 4.5em; font-size: 13px; font-variant-numeric: tabular-nums; }
.le-step { min-width: 36px; min-height: 32px; padding: 0 8px; }
.le-note { margin: 6px 0 0; font-size: 12px; }
@media (max-width: 560px) {
  .yc-row { grid-template-columns: 24px minmax(0, 1fr); }
  .yc-acts { grid-column: 2; }
}
.setup-box.part-fx-thanks { background: rgba(255, 214, 10, .8); color: var(--ink); border-color: var(--ink); }
.setup-box.part-fx-stamp { background: rgba(123, 47, 242, .45); border-style: dashed; z-index: 2; }

/* 保留（保留する言葉に一致） */
.rm-hold { color: var(--warn); }
.hold-note { padding: 8px 12px; border-radius: 10px; background: #2b2610; border: 1px solid var(--warn); font-size: 14px; margin-bottom: 8px; }

/* 対象期間（台本づくりのデータ収集期間。編成・振り返りのヘッダー） */
.range-box { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; min-width: 0; }
.range-box[hidden] { display: none; }
.range-box select { width: auto; max-width: 100%; }
.range-label { color: var(--text-2); font-size: 13px; }
.range-custom { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.range-custom[hidden] { display: none; }
.range-in { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; min-width: 0; }
.range-in input { width: 16em; max-width: calc(100vw - 80px); color-scheme: dark; }
.range-msg { color: var(--warn); font-size: 13px; }
.badge-out { background: var(--surface-2); color: var(--warn); border-color: var(--warn); }
.rm-out { color: var(--warn); }

/* 台本ファイルの取り込み（確認） */
.script-confirm { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 14px; display: grid; gap: 6px; }
.script-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.script-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
.script-slot { flex: none; font-weight: 800; color: var(--yellow); min-width: 6.5em; }
.script-name { font-weight: 800; overflow-wrap: anywhere; min-width: 0; }
.script-replace { color: var(--warn); font-size: 13px; }
.script-warn { margin: 0 0 0 18px; color: var(--warn); font-size: 13px; }

/* 進行: 関連投稿（全件）と「これを映す」 */
.live-post { border: 2px solid transparent; border-radius: 16px; padding: 4px; margin-top: 6px; min-width: 0; }
.live-post.is-shown { border-color: var(--yellow); background: rgba(255, 214, 10, .06); }
.lp-bar { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-height: 32px; }
.lp-bar .live-h3 { margin: 0; }
.live-post.is-compact .lp-bar { justify-content: flex-start; min-height: 0; margin-bottom: 2px; }
.badge-shown { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-show { min-height: 30px; padding: 2px 12px; }
.live-related { margin-top: 12px; min-width: 0; }
.rel-order { margin-left: auto; display: inline-flex; gap: 4px; }
.rel-order .btn { min-height: 28px; padding: 2px 10px; font-size: 12px; }
.rel-order .btn.is-on { background: var(--text); color: var(--ink); border-color: var(--text); }
.rel-more { margin-top: 8px; }
.live-post .post.is-compact { margin: 0; }

/* 進行: 話題の投稿（並べ替え・今の投稿・画像）。DOM の順は固定で CSS の order で並べる */
.live-items { margin-top: 4px; min-width: 0; }
.live-items.is-file-over { outline: 3px dashed var(--yellow); outline-offset: 4px; border-radius: 16px; }
.li-head { margin-bottom: 4px; }
.li-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.li-item { margin-top: 0; cursor: pointer; background: rgba(255, 255, 255, .02); }
.li-item:hover { border-color: var(--line); }
.li-item.is-shown { border-color: var(--yellow); }
.li-bar { cursor: grab; user-select: none; padding: 2px 4px; border-radius: 10px; background: var(--surface-2); margin-bottom: 4px; gap: 6px; min-height: 34px; }
.li-bar:active { cursor: grabbing; }
.li-handle { color: var(--muted); font-size: 13px; letter-spacing: -3px; padding: 0 6px 0 2px; white-space: nowrap; }
.li-no { font-size: 12px; font-weight: 800; color: var(--text-2); white-space: nowrap; }
.li-sp { flex: 1; }
.li-x, .li-more { min-height: 28px; padding: 0 10px; }
.li-menu { position: relative; }
.li-menu > summary { list-style: none; }
.li-menu > summary::-webkit-details-marker { display: none; }
.li-menu .menu-list { right: 0; left: auto; }
.li-kind { background: var(--surface); color: var(--text); border-color: var(--line); }
.li-item.is-drop-over { box-shadow: 0 -4px 0 0 var(--yellow); }
.li-end { order: 9999; min-height: 28px; border: 2px dashed transparent; border-radius: 10px; font-size: 12px; color: var(--muted); display: grid; place-items: center; }
body.is-dragging .li-end { border-color: var(--line); }
.li-end.is-drop-over { border-color: var(--yellow); color: var(--text); }
.li-figure { margin: 0; display: grid; gap: 6px; }
.li-img { max-width: 100%; height: auto; max-height: 360px; object-fit: contain; border-radius: 12px; background: #000; justify-self: start; }
.li-cap { width: 100%; }
.li-img-wait { padding: 20px; }
.rel-manual { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.li-add { margin-left: 4px; }
.pv-images { margin-top: 10px; }
.pv-img-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.pv-img-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.pv-img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; background: #000; }
.pv-img-cap { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 進行: 上部に固定するヘッダー（細い進行バー＋コンパクトな話題・タイマー）・リード文のトグル・投稿のグリッド・クリック受け */
.live-sticky { position: sticky; top: 0; z-index: 15; background: var(--bg); padding: 4px 0 6px; display: grid; gap: 4px; margin: 0 -2px; box-shadow: 0 6px 12px -8px rgba(0, 0, 0, .8); }
.live-head.is-compact { padding: 8px 12px; gap: 4px; border-radius: 16px; }
.lh-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.live-head.is-compact .live-icon { width: 26px; height: 26px; flex: none; }
.live-head.is-compact .live-icon .icon { width: 15px; height: 15px; }
.lh-corner-name { flex: none; font-weight: 800; font-size: 13px; white-space: nowrap; }
.live-head.is-compact .lh-title { flex: 1; min-width: 0; font-size: clamp(18px, 2.4vw, 28px); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.live-head.is-compact .lh-row { gap: 4px 10px; }
.live-head.is-compact .live-timer { gap: 4px 14px; }
.live-head.is-compact .tm-v { font-size: 22px; }
.live-head.is-compact .tm-k { font-size: 11px; }
.live-head.is-compact .live-start .btn { min-height: 32px; padding: 2px 12px; font-size: 13px; }
.live-head.is-compact .btn-start { min-height: 36px; font-size: 15px; }
.lh-obs { min-height: 0; }
.live-lead-box { margin-top: 6px; }
.live-lead-sum { cursor: pointer; font-weight: 800; font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 6px; list-style: none; }
.live-lead-sum::-webkit-details-marker { display: none; }
.live-lead-sum::before { content: '▸'; display: inline-block; transition: transform .15s; }
.live-lead-box[open] > .live-lead-sum::before { transform: rotate(90deg); }
.live-lead-box .live-lead { margin-top: 4px; }
.live2 .li-list { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.li-end { grid-column: 1 / -1; }
.li-body { position: relative; min-width: 0; }
.li-catch { position: absolute; inset: 0; z-index: 2; cursor: pointer; border-radius: 12px; }
.li-catch:hover { background: rgba(255, 214, 10, .06); }
.li-interact.is-on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.viewer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 8px; }
.viewer-presets .btn.is-on { background: var(--text); color: var(--ink); }
@media (max-width: 520px) { .viewer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) {
  .live2 .li-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live2 .li-item.is-drop-over { box-shadow: -6px 0 0 0 var(--yellow); }
}
@media (min-width: 1400px) {
  .live2 .li-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.li-item { scroll-margin-top: 190px; scroll-margin-bottom: 120px; }
.li-interact { font-size: 11px; padding: 0 8px; min-height: 26px; white-space: nowrap; }
.row-item.has-x { grid-template-columns: 18px 26px 6px minmax(0, 1fr) 34px 40px; }
.row-x { all: unset; box-sizing: border-box; width: 34px; height: 34px; border-radius: 10px; text-align: center; line-height: 32px; cursor: pointer; font-size: 16px; color: var(--text-2); }
.row-x:hover, .row-x:focus-visible { background: var(--surface-2); color: var(--text); }
.rm-rep { background: var(--yellow); color: var(--ink); border-radius: 6px; padding: 0 6px; font-weight: 800; }
.lp-topic-tools { padding: 4px 10px 8px; gap: 6px 8px; font-size: 12px; }
.pv-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.pv-pos { font-size: 12px; }
.pv-items { margin-top: 10px; }
.pv-item-list { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; max-height: 240px; overflow: auto; }
.pv-item { all: unset; box-sizing: border-box; display: flex; gap: 6px; align-items: center; width: 100%; padding: 4px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-item:hover, .pv-item:focus-visible { background: var(--surface-2); }
.url-dialog textarea { width: 100%; }
.url-conflict { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--warn); border-radius: 10px; font-size: 14px; }
.url-conflict ul { margin: 4px 0 0 18px; }
.is-drop-no { opacity: .45; filter: grayscale(1); outline: 2px dashed var(--muted); outline-offset: -2px; cursor: not-allowed; }
.drag-ghost.is-no { background: #3a2a2a; border-color: var(--over); }
.tree-more { all: unset; box-sizing: border-box; width: 26px; height: 26px; border-radius: 8px; text-align: center; line-height: 24px; color: var(--muted); cursor: pointer; flex: none; font-size: 14px; }
.tree-more:hover, .tree-more:focus-visible { background: var(--surface-2); color: var(--text); }
.tree-node .tree-label[data-draggable] { touch-action: pan-y; }
.bot-pill[data-state="done"] { background: var(--surface-2); color: var(--text-2); }
.bot-pill[data-state="pending"], .bot-pill[data-state="sending"] { background: var(--warn); border-color: var(--warn); color: var(--ink); }
.bot-pill[data-state="error"], .bot-pill[data-state="stopped"] { background: #5a1410; border-color: var(--over); color: #fff; }
.bot-pill[hidden] { display: none; }
.rm-est { color: #9fd3ff; }
.badge-est { background: #10304a; color: #cfe8ff; border-color: #5ea0ff; }

/* ================================================================ かんたん編成（#plan）: 2 つのステップ（① 左＝投稿・右＝まとまり／② 左＝まとまり・右＝番組の流れ）。ドラッグ＆ドロップ
   基準は画面半分（960×1040）の 2 列。1400px 以上は右にプレビューの列、760px 以下は 1 列（左／右の切り替え）。 */
.bd { display: flex; flex-direction: column; height: calc(100dvh - var(--hdr, 120px)); min-height: 480px; padding: 8px 12px 10px; gap: 8px; }
.bd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.bd-titlebox { flex: 1 1 220px; min-width: 0; }
.bd-titlebox .input { width: 100%; }
.bd-top .btn:disabled { opacity: .4; }
.bd-more > summary { min-width: 44px; justify-content: center; }
.bd-more .menu-list { min-width: 290px; }
.bd-more a.menu-item { text-decoration: none; }
/* 「整理開始」ボタンと進み具合のパネル（閉じても裏で進む） */
.bd-seiri { background: var(--yellow); color: var(--ink); border-color: var(--yellow); font-weight: 900; gap: 6px; }
.bd-seiri:hover { filter: brightness(1.08); }
.bd-seiri.is-running { background: #3a3520; color: var(--yellow); border-color: var(--yellow); }
.bd-seiri-dot { width: 8px; height: 8px; border-radius: 50%; background: #77776a; flex: none; }
.bd-seiri-dot.is-on { background: #1e9e4a; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.seiri-panel { position: fixed; right: 16px; top: max(16px, calc(var(--hdr, 120px) + 112px)); z-index: 60; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - var(--hdr, 120px) - 130px); min-height: 200px; overflow-y: auto; background: #1d1d23; border: 2px solid var(--yellow); border-radius: 18px; padding: 12px 14px 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); display: grid; gap: 10px; }
.sr-head { display: flex; align-items: center; gap: 8px; }
.sr-head h2 { flex: 1; margin: 0; font-size: 17px; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sr-head h2 small { font-size: 12px; color: var(--muted); font-weight: 600; }
.sr-head .btn { min-height: 40px; }
.sr-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sr-step { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.sr-mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; background: #3a3a44; color: #ddd; }
.sr-step.is-run .sr-mark { background: var(--yellow); color: var(--ink); }
.sr-step.is-ok .sr-mark { background: #1e9e4a; color: #fff; }
.sr-step.is-ng .sr-mark, .sr-step.is-ask .sr-mark { background: #ff8a80; color: var(--ink); }
.sr-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.sr-title { font-size: 14px; }
.sr-text { margin: 0; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.sr-step.is-ng .sr-text { color: #ffb4ab; }
.sr-stages { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.sr-stages li { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.sr-stages li.is-done { color: #9fe0b2; border-color: #2f6b43; }
.sr-stages li.is-now { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.sr-bar { height: 6px; border-radius: 6px; background: #3a3a44; overflow: hidden; }
.sr-bar > span { display: block; height: 100%; background: var(--yellow); }
.sr-ask { margin-top: 4px; }
.sr-ask .btn, .sr-sum .btn { min-height: 40px; }
.sr-sum { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.sr-sum p { margin: 0; }
.sr-sum-text { font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.sr-chip { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px; border-radius: 12px; background: #2b2a22; border: 1.5px solid var(--yellow); color: var(--yellow); font-weight: 800; font-size: 13px; cursor: pointer; min-width: 0; }
.sr-chip:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr-chip.is-info { background: var(--surface-2); border-color: var(--line); color: var(--text-2); }
.sr-chip.is-auto { cursor: default; color: var(--text); flex-wrap: wrap; }
.sr-chip-tx { flex: 1; min-width: 0; }
.sr-chip-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: sr-pulse 1.6s ease-in-out infinite; }
.sr-chip.is-auto .sr-chip-dot, .sr-chip.is-info .sr-chip-dot { animation: none; }
@keyframes sr-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .sr-chip-dot { animation: none; } }
@media (max-width: 760px) { .seiri-panel { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; max-height: 70dvh; } }

/* ステップの切り替え（① 投稿からまとまりを作る → ② まとまりを番組に並べる） */
.bd-steps { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 8px; }
.bd-step { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; min-height: 52px; min-width: 0; padding: 6px 14px; border-radius: 16px; border: 2px solid var(--line); cursor: pointer; }
.bd-step:hover { border-color: #77778a; }
.bd-step:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.bd-step.is-on { background: var(--g-white); color: var(--ink); border-color: var(--g-white); cursor: default; }
.bd-step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; background: var(--surface-2); color: var(--text-2); }
.bd-step.is-on .bd-step-n { background: var(--g-main); color: #fff; }
.bd-step-tx { display: grid; min-width: 0; }
.bd-step-t { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-step-s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-step.is-on .bd-step-s { color: #55555f; }
.bd-step-arrow { align-self: center; color: var(--muted); font-weight: 900; }
.bd-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); gap: 12px; }
@media (min-width: 1400px) { .bd.is-wide .bd-cols { grid-template-columns: minmax(0, 40fr) minmax(0, 50fr) minmax(440px, 46fr); } }
.bd-col { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; background: var(--surface); border-radius: 22px; padding: 12px 12px 0; border: 2px solid transparent; }
.bd-col.is-hidden { display: none; }
.bd.is-panel:not(.is-narrow) .bd-preview { grid-column: 1; grid-row: 1; }
.bd-head { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 32px; }
.bd-h { font-size: 17px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1 1 auto; white-space: nowrap; }
.bd-h small { font-size: 12px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bd-back { flex: none; min-height: 32px; padding: 2px 12px; font-size: 13px; }
.bd-total { margin-left: auto; flex: none; font-size: 13px; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.bd-total.is-over { color: var(--over); }
.bd-search .input { width: 100%; }
.bd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bd-chip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; min-height: 40px; padding: 4px 11px; border-radius: 999px; font-weight: 800; font-size: 12.5px; background: var(--surface-2); border: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.bd-chip:hover { border-color: var(--line); }
.bd-chip:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.bd-chip[aria-pressed="true"] { background: var(--g-white); color: var(--ink); }
.bd-chip.is-new { color: var(--yellow); }
.bd-chip.is-new[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.bd-dot { width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex: none; }
.bd-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 7px; padding: 2px 2px 14px; margin: 0 -2px; }
.bd-scroll > * { flex: none; }
.bd-note { font-size: 12px; color: var(--muted); }
.bd-empty { margin: 4px 0; }
.bd-more-btn { align-self: center; }
.bd-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 10px; border-top: 1px solid var(--line); }
.bd-foot .btn { min-height: 40px; padding: 4px 12px; font-size: 13px; }

/* ステップ①: 左の投稿の行（チェック・つまみ・本文）、選択中のバー、右のまとまりのカード */
.bd-filter { flex: none; width: auto; max-width: 62%; min-height: 34px; padding-top: 2px; padding-bottom: 2px; font-size: 12.5px; }
.bd-post.is-list { gap: 6px; }
.bd-chk { flex: none; width: 40px; align-self: stretch; display: grid; place-items: center; cursor: pointer; margin-right: -8px; }
.bd-chk.is-off { cursor: default; }
.bd-chk-in { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; border-radius: 6px; border: 2px solid #8d8d99; background: transparent; cursor: pointer; display: grid; place-items: center; }
.bd-chk-in:checked { background: var(--yellow); border-color: var(--yellow); }
.bd-chk-in:checked::after { content: "✓"; color: var(--ink); font-weight: 900; font-size: 15px; line-height: 1; }
.bd-chk-in:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.bd-chk-in:disabled { visibility: hidden; }
.bd-post.is-checked { border-color: rgba(255, 214, 10, .6); background: #2b2a22; }
.bd-star { color: var(--yellow); margin-right: 4px; font-size: 12px; }
.bd-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 7px 8px 7px 14px; border-radius: 16px; background: var(--g-white); color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.bd-selbar-n { font-weight: 800; font-size: 14px; margin-right: auto; white-space: nowrap; }
.bd-selbar .btn { min-height: 40px; padding: 4px 14px; font-size: 13px; }
.bd-selbar .bd-selbar-clear { background: #d9d9de; color: var(--ink); border-color: transparent; }
.bd-card.is-group { cursor: pointer; }
.bd-card.is-group .bd-tx { padding-left: 12px; }
.bd-kind { flex: none; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 0 7px; line-height: 17px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.bd-kind.is-made { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.bd-place { flex: none; font-size: 10.5px; font-weight: 800; border-radius: 6px; padding: 0 6px; line-height: 17px; background: var(--g-main); color: #fff; white-space: nowrap; }
.bd-chev { flex: none; width: 28px; height: 28px; display: grid; place-items: center; color: #c9c9d3; }
.bd-chev::before { content: ""; width: 8px; height: 8px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translateX(-2px) rotate(-45deg); }
.bd-card.is-open-head .bd-chev::before { transform: translateY(-2px) rotate(45deg); }
.bd-zone.is-new { cursor: pointer; min-height: 60px; }
.bd-zone.is-new:hover { border-color: #8d8d99; color: var(--text-2); }
.bd-zone.is-new:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
/* どのカードにも置けるので、置ける印はひかえめに（指の下のカードだけ強く光る） */
.bd-card.is-group.is-drop-ok, .bd-groups .bd-open.is-drop-ok { border-color: rgba(255, 214, 10, .3); }
.bd-lift-n { position: absolute; right: -8px; top: -11px; min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-weight: 900; font-size: 12.5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.drag-lift > .bd-post, .drag-lift > .bd-card { position: relative; }

/* カード（話題） */
.bd-card { position: relative; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 14px; padding: 8px 8px 8px 0; min-height: 56px; min-width: 0; cursor: grab; user-select: none; -webkit-user-select: none; border: 2px solid transparent; }
.bd-card:hover { border-color: var(--line); }
.bd-card:focus-visible, .bd-post:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; box-shadow: none; }
.bd-card.is-sel, .bd-post.is-sel { border-color: var(--g-white); }
.bd-stripe { align-self: stretch; width: 6px; border-radius: 12px 0 0 12px; flex: none; margin: -8px 0; }
.bd-grip { flex: none; width: 26px; align-self: stretch; display: flex; align-items: center; justify-content: center; color: #8d8d99; font-size: 15px; letter-spacing: -2px; white-space: nowrap; overflow: hidden; cursor: grab; touch-action: none; }
.bd-grip.is-off { visibility: hidden; }
.bd-tx { flex: 1; min-width: 0; display: grid; gap: 1px; }
.bd-ttl { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bd-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bd-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-mark { flex: none; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 0 6px; line-height: 17px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.bd-mark.is-star { border-color: var(--yellow); color: var(--yellow); }
.bd-mark.is-new { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.bd-mark.is-pick { border-color: var(--g-general); color: var(--g-general); }
.bd-mark.is-bot.is-low, .bd-mark.is-out { border-color: var(--warn); color: var(--warn); }
.bd-used { flex: none; font-size: 11px; font-weight: 800; background: #3a3a44; border-radius: 999px; padding: 1px 8px; color: #ddd; white-space: nowrap; }
.bd-card.is-used { cursor: pointer; }
.bd-card.is-used > :not(.bd-tx), .bd-card.is-used .bd-name, .bd-card.is-used .bd-meta, .bd-card.is-used .bd-mark { opacity: .45; }
.bd-slotn { flex: none; min-width: 22px; height: 20px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 900; background: var(--g-main); color: #fff; border-radius: 8px; padding: 0 6px; }
.bd-rd { all: unset; box-sizing: border-box; flex: none; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; position: relative; font-weight: 900; }
.bd-rd::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; }
.bd-add { color: var(--ink); font-size: 18px; isolation: isolate; }
.bd-add::before { background: #fff; z-index: -1; }
.bd-x { color: #c9c9d3; font-size: 13px; }
.bd-x::before { border: 2px solid #55555f; }
.bd-rd:hover::before { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.bd-rd:focus-visible { outline: 3px solid var(--yellow); outline-offset: -2px; }
.bd-card.is-flash, .bd-open.is-flash { animation: bd-flash 1.4s ease-out 1; }
@keyframes bd-flash { 0%, 55% { box-shadow: 0 0 0 4px var(--yellow); } 100% { box-shadow: 0 0 0 4px rgba(255, 214, 10, 0); } }
@media (prefers-reduced-motion: reduce) { .bd-card.is-flash, .bd-open.is-flash { animation: none; outline: 3px solid var(--yellow); } }

/* 右: コーナー */
.bd-sec { display: grid; gap: 7px; margin-top: 4px; }
.bd-sec-h { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 800; font-size: 14px; }
.bd-sec-dot { width: 20px; height: 20px; border-radius: 50%; flex: none; border: 3px solid var(--surface); box-shadow: 0 0 0 2px currentColor inset; }
.bd-sec-name { white-space: nowrap; }
.bd-sec-sub { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-list { display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr); }
.bd-zone { box-sizing: border-box; min-height: 56px; display: grid; place-items: center; text-align: center; padding: 6px 10px; border: 2.5px dashed #5a5a66; border-radius: 14px; color: var(--muted); font-weight: 700; font-size: 13px; }
.bd-zone.is-thin { min-height: 52px; border-width: 2px; font-weight: 600; }
.bd-zone.is-drop-ok { border-color: var(--yellow); color: var(--yellow); background: rgba(255, 214, 10, .07); }
.bd-zone.is-drop-over, .bd-card.is-drop-over, .bd-open.is-drop-over { border-color: var(--yellow) !important; background: rgba(255, 214, 10, .2); color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 214, 10, .22); }
.bd-card.is-drop-over .bd-name, .bd-card.is-drop-over .bd-meta { color: var(--yellow); }
.is-drop-no { cursor: not-allowed !important; }
.bd-zone.is-drop-no, .bd-card.is-drop-no { border-color: #ff8a80 !important; opacity: .7; }

/* 開いた話題 */
.bd-open { background: #1d1d23; border: 2px solid var(--g-white); border-radius: 16px; padding: 6px; min-width: 0; }
.bd-open > .bd-card { background: transparent; border-color: transparent; }
.bd-open-body { display: grid; gap: 6px; padding: 0 4px 6px; grid-template-columns: minmax(0, 1fr); }
.bd-open-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--muted); padding: 0 2px; }
.bd-link { all: unset; cursor: pointer; font-weight: 800; color: var(--text); text-decoration: underline; min-height: 28px; display: inline-flex; align-items: center; }
.bd-link:focus-visible { outline: 3px solid var(--yellow); }
.bd-posts { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.bd-post { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 5px 4px 5px 0; min-height: 52px; min-width: 0; cursor: grab; user-select: none; -webkit-user-select: none; border: 2px solid transparent; }
.bd-post:hover { border-color: var(--line); }
.bd-th { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; background: linear-gradient(135deg, #444, #2a2a30); }
.bd-th.is-ph { display: grid; place-items: center; font-size: 10px; color: var(--muted); }
.bd-ptx { flex: 1; min-width: 0; }
.bd-pt { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-pm { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-rep { display: inline-block; font-size: 10.5px; font-weight: 900; background: var(--yellow); color: var(--ink); border-radius: 6px; padding: 0 6px; margin-right: 6px; }
.bd-from { margin-left: 6px; color: var(--text-2); }
.bd-post.is-in { cursor: pointer; }
.bd-post.is-in > * { opacity: .45; }
.bd-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.bd-mini .btn { min-height: 40px; padding: 4px 12px; font-size: 13px; }
.bd-script { font-size: 13px; }
.bd-script summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; color: var(--text-2); }
.bd-script textarea { width: 100%; }

/* 左の列: 右から持ってきたときの案内（ドラッグ中だけ） */
.bd-drop-note { display: none; position: absolute; inset: 0; z-index: 4; border-radius: 20px; place-items: center; text-align: center; padding: 20px; font-weight: 800; font-size: 15px; color: var(--yellow); background: rgba(11, 11, 13, .82); border: 3px dashed var(--yellow); pointer-events: none; }
.bd-left.is-drop-ok .bd-drop-note { display: grid; opacity: .0; }
.bd-left.is-drop-ok { border-color: rgba(255, 214, 10, .45); border-style: dashed; }
.bd-left.is-drop-over .bd-drop-note { opacity: 1; }
.bd-drop-note .for-post { display: none; }
body[data-drag-kind="post"] .bd-drop-note .for-post { display: inline; }
body[data-drag-kind="post"] .bd-drop-note .for-topic { display: none; }

/* プレビュー */
.bd-preview .bd-scroll { gap: 10px; }
.bd-preview .pv-post { max-width: 560px; }
.bd-pv-nav { align-items: center; }

/* お知らせ（元に戻す）は下に出るので、下のカードや置き場所を押す・つかむじゃまをしない */
body[data-route="plan"] .toast { pointer-events: none; }
body[data-route="plan"] .toast .toast-undo { pointer-events: auto; }
body.is-dragging .toast { opacity: .12; }

/* ドラッグ中: つかんだカードの写し・入る位置の線・指のそばの文 */
.is-drag-src { opacity: .28 !important; }
.drag-lift { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; transform-origin: 20% 50%; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .65)); }
.drag-lift > * { margin: 0 !important; background: #2d2d36 !important; box-shadow: 0 0 0 3px var(--yellow); border-color: transparent !important; opacity: 1 !important; animation: none !important; }
.drag-lift.is-no > * { box-shadow: 0 0 0 3px #ff8a80; }
.drag-lift .bd-rd { visibility: hidden; }
.drag-tip { position: fixed; left: 0; top: 0; z-index: 101; pointer-events: none; max-width: 280px; padding: 4px 10px; border-radius: 10px; background: var(--yellow); color: var(--ink); font-weight: 800; font-size: 12.5px; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
.drag-tip.is-no { background: #ff8a80; }
.drop-line { position: fixed; left: 0; top: 0; z-index: 99; pointer-events: none; height: 4px; border-radius: 4px; background: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 214, 10, .28); }
.ctx-label { display: grid; gap: 1px; min-width: 0; }
.ctx-note { font-size: 11px; font-weight: 600; opacity: .8; white-space: normal; }

/* 760px 以下: 1 列（素材／番組の切り替え）。「＋」で入れる */
.bd-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bd-tab { all: unset; box-sizing: border-box; min-height: 44px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-2); font-weight: 800; font-size: 14px; cursor: pointer; border: 2px solid transparent; }
.bd-tab.is-on { background: var(--g-white); color: var(--ink); }
.bd-tab:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
/* 狭い画面はページごとスクロール（列の中だけのスクロールにしない） */
.bd.is-narrow { padding: 6px 8px 8px; height: auto; min-height: 0; }
.bd.is-narrow .bd-scroll { overflow: visible; padding-bottom: 80px; }
.bd.is-narrow .bd-tabs { position: sticky; top: 0; z-index: 12; background: var(--bg); padding: 4px 0; }
.bd.is-narrow .bd-cols { grid-template-columns: minmax(0, 1fr); }
.bd.is-narrow[data-tab="material"] .bd-right, .bd.is-narrow[data-tab="flow"] .bd-left { display: none; }
.bd.is-narrow.is-panel .bd-left, .bd.is-narrow.is-panel .bd-right { display: none; }
.bd.is-narrow .bd-col { border-radius: 18px; padding: 10px 8px 0; }
.bd.is-narrow .bd-redo { display: none; }
.bd.is-narrow .bd-steps { gap: 4px; }
.bd.is-narrow .bd-step { padding: 6px 8px; gap: 6px; min-height: 48px; }
.bd.is-narrow .bd-step-n { width: 22px; height: 22px; font-size: 12px; }
.bd.is-narrow .bd-step-t { font-size: 12.5px; line-height: 1.25; white-space: normal; }
.bd.is-narrow .bd-step-s { font-size: 10.5px; }
.bd.is-narrow .bd-selbar { position: sticky; bottom: 8px; z-index: 11; }
.pt-back { text-decoration: none; }

/* ---------- 添付メディア（写真・動画。ダッシュボードと同じ部品 assets/js/media.js。2026-11-28） ---------- */
.media { display: grid; gap: 8px; margin-top: 10px; }
.media-grid { display: grid; gap: 4px; border-radius: 12px; overflow: hidden; max-width: 560px; }
.media-grid.n1 { grid-template-columns: 1fr; }
.media-grid.n2 { grid-template-columns: 1fr 1fr; }
.media-grid.n3 { grid-template-columns: 1fr 1fr; }
.media-grid.n3 > :first-child { grid-row: span 2; }
.media-grid.n4 { grid-template-columns: 1fr 1fr; }
.media-thumb {
  display: block; position: relative; padding: 0; border: 0; margin: 0; cursor: zoom-in;
  background: #2c2c34; min-height: 120px; aspect-ratio: 16 / 10; overflow: hidden; width: 100%;
}
.media-grid.n1 .media-thumb { aspect-ratio: auto; max-height: 420px; }
.media-grid.n3 > :first-child { aspect-ratio: auto; }
.media-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-grid.n1 .media-thumb img { height: auto; max-height: 420px; }
.media-thumb.is-broken { cursor: default; }
.media-ph {
  display: flex; align-items: center; justify-content: center; text-align: center; gap: 4px;
  width: 100%; height: 100%; min-height: 120px; padding: 12px;
  color: var(--muted); font-size: 12px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, #2c2c34 10px 20px);
}
.media-ph-row { min-height: 64px; border-radius: 12px; flex-wrap: wrap; }
.media-video { max-width: 560px; }
.media-play {
  position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: #2c2c34; cursor: pointer; aspect-ratio: 16 / 9; color: inherit; text-decoration: none;
}
.media-play img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border-radius: 999px;
  background: rgba(10, 7, 18, .78); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}
.media-play:hover .play-badge, .media-play:focus-visible .play-badge { box-shadow: 0 0 0 2px var(--yellow); }
.media-player { width: 100%; max-height: 480px; border-radius: 12px; background: #000; display: block; }

/* ---------- ライトボックス ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 16px;
  border: 0; background: rgba(5, 3, 10, .92); color: #fff;
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox::backdrop { background: rgba(5, 3, 10, .6); }
.lb-body { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.lb-body img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 8px; }
.lb-caption, .lb-error { font-size: 13px; color: #ddd; max-width: 720px; text-align: center; }
.lb-close { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }

/* プレビューの「写真・動画」（埋め込みの下にデータから） */
.pv-media { margin-top: 10px; }
.pv-media-h { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.pv-post .media-grid, .pv-post .media-video { max-width: 560px; }

/* ================================================================ X と同じ見た目の投稿カード（編成のプレビュー。views/xcard.js）
   X のダークに近い色: 背景 #000・文字 #e7e9ea・うすい文字 #71767b・線 #2f3336・リンク #1d9bf0 */
.xcard { --xc-bg: #000; --xc-text: #e7e9ea; --xc-sub: #71767b; --xc-line: #2f3336; --xc-link: #1d9bf0;
  background: var(--xc-bg); color: var(--xc-text); border: 1px solid var(--xc-line); border-radius: 16px; padding: 12px 16px 10px; max-width: 598px; min-width: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif; font-size: 15px; line-height: 1.5; display: grid; gap: 8px; overflow-wrap: anywhere; }
.xc-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.xc-av { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #333; }
.xc-av.is-small { width: 20px; height: 20px; }
.xc-av.is-initial { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; }
.xc-av.is-small.is-initial { font-size: 11px; }
.xc-names { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 4px; white-space: nowrap; overflow: hidden; }
/* 大きいカードは 2 行（名前・認証 ／ @ID・時刻）。せまい列でも名前が切れすぎないように */
.xc-names.is-two { display: grid; gap: 0; line-height: 1.3; }
.xc-l1, .xc-l2 { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.xc-name { font-weight: 700; color: var(--xc-text); overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.xc-verified { width: 17px; height: 17px; flex: none; align-self: center; }
.xc-handle, .xc-dot, .xc-time { color: var(--xc-sub); flex: none; }
.xc-handle { overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.xc-names.is-small { font-size: 14px; }
.xc-open { flex: none; color: var(--xc-link); font-size: 12.5px; font-weight: 700; text-decoration: none; padding: 4px 10px; border: 1px solid var(--xc-line); border-radius: 999px; min-height: 32px; display: inline-flex; align-items: center; white-space: nowrap; }
.xc-open:hover { background: rgba(29, 155, 240, .1); }
.xc-reply { margin: -4px 0 0; color: var(--xc-sub); font-size: 14px; }
.xc-text, .xc-qtext { margin: 0; white-space: normal; }
.xc-qtext { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.xc-link, .xc-tag { color: var(--xc-link); text-decoration: none; }
.xc-link:hover { text-decoration: underline; }
.xc-mediabox { display: grid; gap: 8px; }
.xc-media { display: grid; gap: 2px; border-radius: 16px; overflow: hidden; border: 1px solid var(--xc-line); }
.xc-media.n1 { grid-template-columns: 1fr; }
.xc-media.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.xc-media.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.xc-media.n3 > :first-child { grid-row: 1 / 3; }
.xc-media.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 16 / 9; }
.xc-photo { all: unset; box-sizing: border-box; display: block; cursor: zoom-in; min-width: 0; min-height: 0; overflow: hidden; background: #16181c; }
.xc-photo:focus-visible { outline: 3px solid var(--xc-link); outline-offset: -3px; }
.xc-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xc-media.n1 .xc-photo img { height: auto; max-height: 510px; }
.xc-photo .media-ph { display: grid; place-items: center; min-height: 120px; height: 100%; color: var(--xc-sub); font-size: 13px; }
.xc-mediabox.is-small .xc-media { border-radius: 12px; }
.xc-mediabox.is-small .xc-media.n1 .xc-photo img { max-height: 260px; }
.xc-video .media-video { border-radius: 16px; overflow: hidden; border: 1px solid var(--xc-line); }
.xc-quote { border: 1px solid var(--xc-line); border-radius: 16px; padding: 10px 12px; display: grid; gap: 6px; cursor: pointer; min-width: 0; }
.xc-quote:hover { background: #080808; }
.xc-quote:focus-visible { outline: 3px solid var(--xc-link); outline-offset: 1px; }
.xc-quote.is-gone { cursor: default; color: var(--xc-sub); background: #16181c; font-size: 14px; }
.xc-qhead { display: flex; align-items: center; gap: 6px; min-width: 0; }
.xc-card { display: flex; flex-direction: column; border: 1px solid var(--xc-line); border-radius: 16px; overflow: hidden; color: var(--xc-text); text-decoration: none; min-width: 0; }
.xc-card:hover { background: #080808; }
.xc-card-img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: #16181c; }
.xc-card-tx { display: grid; gap: 2px; padding: 10px 12px; min-width: 0; }
.xc-card-dom, .xc-card-desc { color: var(--xc-sub); font-size: 13px; }
.xc-card-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.xc-card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xc-more { color: var(--xc-link); font-size: 14px; text-decoration: none; justify-self: start; padding: 4px 0; min-height: 32px; display: inline-flex; align-items: center; }
.xc-metrics { display: flex; justify-content: space-between; gap: 6px; color: var(--xc-sub); font-size: 13px; max-width: 425px; padding-top: 2px; }
.xc-m { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.xc-ic { width: 18px; height: 18px; flex: none; }
.xc-toggle { margin-top: 8px; }
.xc-toggle .btn { min-height: 36px; font-size: 12.5px; }
@media (max-width: 760px) { .xcard { padding: 10px 12px; font-size: 14.5px; } .xc-metrics { font-size: 12px; } }
