:root {
  color-scheme: light dark;
  --bg: #f6f6f8; --card: #fff; --text: #1b1b20; --muted: #6b6b76; --line: #e2e2e8;
  --accent: #d6245f; --accent-text: #fff; --ok: #14804a; --warn: #a15c00; --bad: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131316; --card: #1d1d22; --text: #ececf1; --muted: #9a9aa6; --line: #33333b;
    --ok: #5ac98e; --warn: #e0a64f; --bad: #f2877e; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; }
header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
header h1 { font-size: 16px; margin: 0; flex: 1; }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 380px; margin: 8vh auto 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
h2 { font-size: 15px; margin: 0 0 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
button { font: inherit; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { color: var(--bad); }
button.small { padding: 4px 9px; font-size: 13px; }
.error { color: var(--bad); font-size: 14px; min-height: 1.4em; margin: 6px 0; }
.note { color: var(--muted); font-size: 13px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button { white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; align-items: end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
td.actions { display: flex; gap: 6px; }
.status-active { color: var(--ok); } .status-scheduled { color: var(--warn); } .status-left { color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); padding: 20px; width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.credentials { background: var(--bg); border-radius: 8px; padding: 12px; font-size: 16px; word-break: break-all; }
.credentials b { font-family: ui-monospace, Menlo, monospace; }
.name { font-size: 20px; font-weight: 700; }
.center { text-align: center; margin-top: 20vh; color: var(--muted); }
textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; resize: vertical; min-height: 110px; }
dialog.wide { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.memo-list { list-style: none; margin: 16px 0 0; padding: 0; }
.memo-list li { border-top: 1px solid var(--line); padding: 10px 0; }
.memo-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.memo-meta .spacer { flex: 1; }
.memo-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.tag { display: inline-block; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--text); }
.tag.health { color: var(--warn); border-color: currentColor; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px 4px; margin: 0 0 12px; }
legend { padding: 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
label.check input { width: auto; margin: 0; }
input[type=range] { padding: 0; }
input[type=color] { padding: 2px; height: 38px; }
.row.left { justify-content: flex-start; }
.design { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.design .card:first-child { position: sticky; top: 12px; }
@media (max-width: 760px) { .design { grid-template-columns: 1fr; } .design .card:first-child { position: static; } }
.preview-frame { aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; border-radius: 10px; overflow: hidden; background: #2a2a31; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
td.memo-cell { max-width: 240px; white-space: normal; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.flag { display: inline-block; padding: 0 7px; margin: 1px 4px 1px 0; border-radius: 999px; font-size: 12px; color: var(--bad); border: 1px solid currentColor; white-space: nowrap; }
.progress { font-variant-numeric: tabular-nums; }

h2.spaced { margin-top: 16px; }
.inline-field { align-items: center; } .inline-field input { flex: 1; margin: 0; }
.movie-preview { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }

.action-item { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.action-item .action-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; margin-bottom: 4px; }

.counter-item { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0 8px; align-items: end; border: 1px dashed var(--line); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; }

.bingo-edit { display: grid; gap: 4px; margin-top: 8px; max-width: 360px; }
.bingo-edit button { padding: 8px 4px; font-size: 13px; } .bingo-edit button.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.notice-item + .notice-item { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.notice-head { font-weight: 700; } .notice-body { white-space: pre-wrap; color: var(--muted); font-size: 14px; }

.share-page { max-width: 560px; }
.share-head { display: flex; align-items: center; gap: 10px; }
.share-head .tag { color: var(--accent); border-color: currentColor; }
.share-rank { margin: 0; padding-left: 1.6em; }
.share-rank li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.share-rank li b { font-variant-numeric: tabular-nums; }

h3 { font-size: 14px; margin: 12px 0 6px; }
.meter { display: flex; gap: 6px; margin: 4px 0 8px; }
.meter i { flex: 1; height: 16px; border-radius: 4px; background: var(--line); }
.meter.l1 i:nth-child(-n+1), .meter.l2 i:nth-child(-n+2), .meter.l3 i:nth-child(-n+3), .meter.l4 i:nth-child(-n+4), .meter.l5 i:nth-child(-n+5) { background: var(--accent); }
.draw-pad { display: block; width: min(100%, 270px); aspect-ratio: 9 / 16; margin: 0 auto 10px; background: #2a2a31; border-radius: 10px; touch-action: none; cursor: crosshair; }
/* 告知画像のプレビュー。部品を動かす */
.an-phone { margin: 10px auto; width: min(100%, 300px); padding: 8px; border-radius: 28px; background: #111; }
.an-stage { position: relative; aspect-ratio: 1080 / 1920; border-radius: 20px; overflow: hidden; background: #222; }
.an-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.an-guide { touch-action: none; cursor: grab; }
.an-guide:active { cursor: grabbing; }
.an-part-tools { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.an-part-tools .note { margin: 0 0 6px; }
.bg-canvas { display: block; width: min(100%, 270px); margin: 10px auto 0; border-radius: 10px; background: repeating-conic-gradient(#888 0 25%, #bbb 0 50%) 0 0 / 20px 20px; }
a.button-link { display: inline-block; padding: 4px 9px; font-size: 13px; border-radius: 7px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.state-ok { color: var(--ok); } .state-used, .state-expired { color: var(--muted); } .state-soon { color: var(--warn); }
.heat td, .heat th { text-align: center; padding: 3px 4px; font-size: 11px; min-width: 26px; }
.heat td.h1 { background: color-mix(in srgb, var(--accent) 12%, transparent); } .heat td.h2 { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.heat td.h3 { background: color-mix(in srgb, var(--accent) 50%, transparent); } .heat td.h4 { background: color-mix(in srgb, var(--accent) 75%, transparent); color: #fff; }
.ai-answer { white-space: pre-wrap; margin-top: 12px; line-height: 1.8; }
.warn-text { color: var(--warn); font-weight: 600; }

/* 置き場所の注意（演出の設定） */
.placement-warn { margin: 1rem 0 .5rem; padding: .6rem .9rem; border: 1px solid var(--warn); border-radius: .6rem; }
.placement-warn p { margin: 0 0 .3rem; }
.placement-warn ul { margin: 0; padding-left: 1.2rem; }
.placement-warn li + li { margin-top: .3rem; }

/* 配信タブの「演出ボタン」：スマホで押しやすい大きさ */
.fx-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 6px 0; }
.fx-buttons:empty { display: none; }
.fx-button { min-height: 64px; padding: 10px; font-size: 16px; font-weight: 700; border-radius: 12px; overflow-wrap: anywhere; }
.fx-button:disabled { opacity: .5; }

/* 演出ボタンの試し聞き：透明なところが分かるように市松模様の上に出す */
dialog.fx-preview { width: min(360px, calc(100vw - 32px)); }
.fx-stage { aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 8px; overflow: hidden;
  background: repeating-conic-gradient(#cfcfcf 0 25%, #f4f4f4 0 50%) 0 0 / 20px 20px; }
.fx-stage video, .fx-stage img { width: 100%; height: 100%; object-fit: contain; }

/* おすすめの出やすさ：次の目標・ひとこと・内訳 */
.meter-goal { margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; }
.meter-tips { margin: 6px 0; padding-left: 1.2em; }
.meter-tips li { margin: 2px 0; }
.meter-part { display: grid; grid-template-columns: 7em 6em 1fr; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
.meter-part b { text-align: right; font-weight: 600; }
.meter-part i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line) var(--p)); }

/* 管理者への知らせ：この端末で通知を受け取る */
.push-box { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.push-box h3 { margin: 0 0 4px; }

/* ファンの掲示板・事務所の掲示板 */
.fan-posts { margin-top: 10px; }
.fan-post, .board-post { padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
.fan-head, .board-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; white-space: normal; }
.fan-head .note, .board-head .note { margin: 0; }
.fan-head button, .board-head button { margin-left: auto; }
.board-replies { margin: 6px 0 0 18px; border-left: 3px solid var(--line); padding-left: 10px; }
.board-tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--accent); color: #fff; }
/* アイコンのフレーム */
.frame-canvas { display: block; width: min(320px, 100%); height: auto; margin: 10px auto; border-radius: 50%; background: repeating-conic-gradient(#e6e6ee 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.frame-canvas.small { width: 160px; }
.frame-maker { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: start; }
@media (max-width: 520px) { .frame-maker { grid-template-columns: 1fr; } }
.frame-file input { display: block; margin-top: 6px; }

/* プレビューの置き場所：配信・演出の設定・きっかけ・ゲームのタブで出す。広い画面では右に固定、狭い画面ではタブの上 */
.preview-dock[hidden] { display: none; }
.preview-dock summary { cursor: pointer; list-style: none; }
.preview-dock > details > summary h2 { display: inline; }
.preview-dock > details > summary::after { content: '（たたむ・ひらく）'; font-size: 12px; color: var(--muted, #888); margin-left: 6px; }
.preview-toggles { gap: 14px; margin: 8px 0 0; }
.preview-try { margin-top: 8px; }
.preview-try > summary { font-weight: 700; padding: 6px 0; }
@media (min-width: 1100px) {
  body.dock-on main { max-width: none; margin: 0 376px 0 max(16px, calc((100vw - 1040px - 376px) / 2)); }
  body.dock-on .design { grid-template-columns: 1fr; }
  .preview-dock { position: fixed; right: 16px; top: 64px; width: 340px; max-height: calc(100vh - 80px); overflow: auto; z-index: 5; }
}
/* スマホの画面のような枠 */
.preview-frame.phone { position: relative; border-radius: 22px; border: 6px solid #111; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-height: 72vh; }
/* TikTokの画面の見本（形だけ。押せない） */
.tt-mock { position: absolute; inset: 0; pointer-events: none; color: #fff; font-size: 9px; font-family: sans-serif; }
.tt-mock[hidden] { display: none; }
.tt-top { position: absolute; top: 3%; left: 3%; right: 3%; display: flex; align-items: center; gap: 4px; }
.tt-avatar { width: 22px; height: 22px; border-radius: 50%; background: #ccc; flex: none; }
.tt-host { display: flex; flex-direction: column; line-height: 1.1; padding: 2px 6px 2px 0; }
.tt-host small { opacity: .8; font-size: 8px; }
.tt-follow { background: #fe2c55; border-radius: 10px; padding: 2px 6px; font-weight: 700; }
.tt-viewers { margin-left: auto; display: flex; align-items: center; }
.tt-viewers i { width: 16px; height: 16px; border-radius: 50%; background: #bbb; border: 1px solid #fff; margin-left: -5px; }
.tt-viewers em { font-style: normal; background: rgba(0,0,0,.35); border-radius: 8px; padding: 1px 5px; margin-left: 3px; }
.tt-x { font-size: 14px; margin-left: 6px; }
.tt-top, .tt-chips span, .tt-host { text-shadow: 0 0 3px rgba(0,0,0,.6); }
.tt-top .tt-host, .tt-top .tt-avatar { } 
.tt-chips { position: absolute; top: 10%; left: 3%; display: flex; gap: 4px; }
.tt-chips span { background: rgba(0,0,0,.3); border-radius: 8px; padding: 2px 6px; }
.tt-left { position: absolute; left: 3%; width: 70%; bottom: 9%; display: flex; flex-direction: column; gap: 3px; }
.tt-gift { display: flex; align-items: center; gap: 4px; background: linear-gradient(90deg, rgba(254,44,85,.85), rgba(254,44,85,0)); border-radius: 12px; padding: 3px 6px; margin-bottom: 4px; width: fit-content; }
.tt-gift i { width: 16px; height: 16px; border-radius: 50%; background: #ffd1dc; }
.tt-gift em { font-style: italic; font-weight: 900; font-size: 13px; color: #ffe14d; }
.tt-comment { background: rgba(0,0,0,.28); border-radius: 10px; padding: 3px 7px; width: fit-content; max-width: 100%; }
.tt-comment b { opacity: .75; margin-right: 4px; }
.tt-hearts { position: absolute; right: 6%; bottom: 10%; width: 30px; height: 40%; }
.tt-hearts i { position: absolute; bottom: 0; left: 8px; width: 14px; height: 14px; background: #fe2c55; transform: rotate(45deg); border-radius: 0 0 0 0; animation: ttHeart 3.2s linear infinite; opacity: 0; }
.tt-hearts i::before, .tt-hearts i::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: inherit; }
.tt-hearts i::before { left: -7px; } .tt-hearts i::after { top: -7px; }
.tt-hearts i:nth-child(2) { animation-delay: .6s; background: #ff8fb1; } .tt-hearts i:nth-child(3) { animation-delay: 1.3s; background: #ffd36b; }
.tt-hearts i:nth-child(4) { animation-delay: 1.9s; background: #9fd8ff; } .tt-hearts i:nth-child(5) { animation-delay: 2.5s; }
@keyframes ttHeart { 0% { opacity: 0; transform: translate(0, 0) rotate(45deg) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-14px, -150px) rotate(45deg) scale(1.1); } }
.tt-bottom { position: absolute; left: 3%; right: 3%; bottom: 2%; display: flex; align-items: center; gap: 6px; }
.tt-input { flex: 1; background: rgba(0,0,0,.35); border-radius: 14px; padding: 5px 8px; opacity: .85; }
.tt-btn { width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.35); flex: none; }
.tt-btn.gift { background: linear-gradient(135deg, #fe2c55, #ff9a3c); }
.preview-try > summary::after { content: '（押すとひらく）'; font-weight: 400; font-size: 12px; color: var(--muted, #888); margin-left: 4px; }
.preview-try[open] > summary::after { content: '（押すとたたむ）'; }
/* 各欄の「試す」ボタン */
.try-btn { margin-left: 8px; padding: 2px 10px; font-size: 12px; border-radius: 999px; background: var(--accent); color: #fff; border: 0; vertical-align: middle; }
legend .try-btn { font-weight: 700; }

/* 管理画面：ライバーごとの詳しい画面 */
dialog.detail-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.detail-sec { margin: 16px 0; }
.detail-sec h3 { margin: 0 0 6px; }
/* 消した書き込み（管理者にだけ見える） */
.is-deleted { opacity: .55; }
.is-deleted > div:last-child { text-decoration: line-through; }
.deleted-tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #888; color: #fff; }

/* バトルアイテムが使われた記録 */
.plain-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; font-size: 14px; }

/* ファンの掲示板の返事 */
.fan-reply { margin: 6px 0 0 12px; padding: 6px 10px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 0 8px 8px 0; }
.fan-reply .tag { margin-right: 4px; }
.fan-reply-edit { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; white-space: normal; }
.fan-reply-edit textarea { flex: 1; min-height: 0; }

/* マネジメント */
.mgmt-note { padding: 10px 0; border-top: 1px solid var(--line); }
.mgmt-note:first-child { border-top: 0; }
.mgmt-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }

/* ファンの掲示板の安全対策 */
.fan-post.is-waiting { background: color-mix(in srgb, var(--warn) 7%, transparent); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.fan-rules { margin: 6px 0 10px; padding-left: 18px; display: grid; gap: 2px; }
.fan-safety { margin: 8px 0; }
.fan-safety summary { cursor: pointer; font-size: 14px; }
.fan-head .small + .small { margin-left: 0; }
.fan-head button { margin-left: 0; }
.fan-head > button:first-of-type { margin-left: auto; }
.fan-head { flex-wrap: wrap; row-gap: 4px; }
.fan-head b, .fan-head .note, .fan-head button, .fan-head .deleted-tag { white-space: nowrap; }
.fan-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.fan-actions button { margin-left: 0 !important; }

/* 全画面のムービー：自分で決めるギフト */
.movie-row { padding: 6px 0; border-top: 1px solid var(--line); }
.movie-row:first-child { border-top: 0; }
.movie-gift { display: flex; align-items: center; gap: 8px; margin: 4px 0 0 26px; font-size: 13px; }
.movie-gift input { flex: 1; max-width: 260px; }

/* ギフトを絵で選ぶ */
.gift-pick-btn { margin-top: 4px; }
.gift-dialog { width: min(720px, calc(100vw - 32px)); max-height: 85vh; border: 0; border-radius: 14px; padding: 16px; }
.gift-dialog::backdrop { background: rgba(0,0,0,.4); }
.gift-dialog-head { display: flex; align-items: center; justify-content: space-between; }
.gift-dialog-head h2 { margin: 0; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; max-height: 60vh; overflow: auto; }
.gift-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); cursor: pointer; }
.gift-item:hover { border-color: var(--accent); }
.gift-item img, .gift-noimg { width: 48px; height: 48px; object-fit: contain; font-size: 34px; line-height: 48px; text-align: center; }
.gift-name { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; text-align: center; }
.gift-dia { font-size: 11px; color: var(--muted, #777); }

/* 交代で出す部品のチェック */
.rotation-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 12px; margin: 6px 0; }

/* 消した素材 */
.media-trash { margin-top: 10px; }
.media-trash summary { cursor: pointer; font-weight: 600; }
/* 配信タブの手書き：たたんでおき、押したときだけ開く */
#drawDetails > summary { cursor: pointer; list-style: none; }
#drawDetails > summary h2 { display: inline; margin: 0; }
#drawDetails > summary::after { content: '（押すとひらく）'; font-size: 12px; color: var(--muted, #888); margin-left: 6px; }
#drawDetails[open] > summary::after { content: '（押すとたたむ）'; }
/* マイページ：上の帯（名前と@ユーザー名）とタブを、いつも上に出しておく */
.liver-page header { position: sticky; top: 0; z-index: 20; }
.liver-page header h1 { flex: 0 0 auto; }
.liver-page header .me { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; white-space: nowrap; }
.liver-page header .me b { overflow: hidden; text-overflow: ellipsis; }
.liver-page .tabs { position: sticky; top: var(--header-h, 53px); z-index: 19; background: var(--bg); margin: 0 -16px 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) {
  .liver-page .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .liver-page header .me { flex-direction: column; gap: 0; line-height: 1.3; }
}
/* 「試す」でプレビューまでスクロールしたとき、上に止めた帯とタブの下に隠れないようにする */
.liver-page .preview-dock { scroll-margin-top: calc(var(--sticky-h, 120px) + 8px); }
/* 録画を上げるときの進み具合 */
.rec-progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0; }
.rec-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.rec-help summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
/* 気をつけること */
.caution-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #fde2e2; color: #b3261e; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.flag-high td:nth-child(3) { color: var(--bad); font-weight: 700; }
.flag-ok td { opacity: .5; }
.auto-memo { margin: 2px 0 4px; }
/* 配信中の知らせ */
.live-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-head h2 { margin: 0; flex: 1; }
.live-notes { display: grid; gap: 8px; margin: 10px 0; }
.live-note { position: relative; border-radius: 10px; padding: 10px 12px 10px 14px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); border-left: 4px solid var(--accent); }
.live-note b { display: block; font-size: 16px; }
.live-note time { position: absolute; right: 10px; top: 8px; color: var(--muted); font-size: 12px; }
.live-note .kind { font-size: 11px; font-weight: 700; color: var(--muted); }
/* 配信中の注意（TikTok の決まりに触れそうな流れ）は、目立つ色にする */
.live-note.warning { background: color-mix(in srgb, #e8a400 14%, var(--card)); border-left-color: #e8a400; }
.live-note.warning .kind { color: #a66f00; }
/* 配信中のひとこと（話とコメントの様子から） */
.live-note.advice { background: color-mix(in srgb, #2f7de1 10%, var(--card)); border-left-color: #2f7de1; }
.live-note.advice .kind { color: #2463b5; }
.live-note.bg { background: color-mix(in srgb, #1a9e6a 10%, var(--card)); border-left-color: #1a9e6a; }
.live-note.bg .kind { color: #12754e; }
.live-note .button-link { margin: 6px 0 2px; }
.live-note.caution { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--card)); }
.live-note.bigGift { border-left-color: #f59e0b; }
.live-note.returning { border-left-color: #10b981; }
.live-feed { max-height: 320px; overflow: auto; font-size: 14px; }
.live-row { padding: 3px 0; border-bottom: 1px solid var(--line); }
.live-row time { color: var(--muted); font-size: 12px; margin-right: 6px; }
.live-row.gift b, .live-row.gift { color: #c2185b; }
.live-feed-box summary, .live-settings summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 6px; }
/* 知らせだけの画面（2台目の端末やパソコンの横に置く） */
.live-mode #tabs, .live-mode #noticeCard, .live-mode [data-panel] > .card:not(#liveCard), .live-mode #previewDock { display: none !important; }
.live-mode [data-panel="broadcast"] { display: block !important; }
.live-mode [data-panel]:not([data-panel="broadcast"]) { display: none !important; }
.live-mode .live-note b { font-size: 20px; }
.live-mode .live-feed { max-height: 50vh; }
/* 手で始める・止める（ふだんはたたんでおく） */
#manualBox > summary { cursor: pointer; list-style: none; }
#manualBox > summary h2 { display: inline; margin: 0; font-size: 14px; color: var(--muted); }
#manualBox > summary::after { content: '（押すとひらく）'; font-size: 12px; color: var(--muted, #888); margin-left: 6px; }
#manualBox[open] > summary::after { content: '（押すとたたむ）'; }
.live-mode #manualCard { display: none !important; }
.pre-line { white-space: pre-line; }
.mgmt-body { white-space: pre-line; }
.mgmt-old summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 8px; }

/* スタッフは、この端末で通知を受け取れるようにするまで管理画面を使えない（push-gate.js） */
body.gated { overflow: hidden; }
.push-gate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 20, 24, .72); }
.push-gate-card { max-width: 460px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; }
.push-gate-card { text-align: center; }
.push-gate-card h2 { margin-bottom: 8px; }
.push-gate-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 8px; }
.push-gate-buttons > * { flex: 1 1 140px; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; }
.push-gate-buttons > a.button-link { display: flex; font-size: inherit; padding: 8px 12px; border-radius: 10px; }
.push-gate-out { margin-top: 8px; }
.help-notify ol { padding-left: 1.4em; line-height: 1.9; }
.help-notify .sym { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; }
.help-notify .other-device { opacity: .55; }

/* パソコンで、通知を受け取るかを小さく聞く（ふさがない） */
.push-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); font-size: 14px; }
.push-offer span { flex: 1 1 200px; }
.push-offer-back { margin: 24px 16px; text-align: center; } .push-offer-back button { margin-left: 8px; }

/* 管理画面のノウハウ */
.knowhow-item { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 6px; }
.knowhow-item.off { opacity: .6; }
.knowhow-item.candidate { border-left: 4px solid #2f7de1; padding-left: 10px; }
.scene-picks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.scene-picks label { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; font-size: .9em; white-space: nowrap; width: auto; margin: 0; }
.scene-picks input { width: auto; margin: 0; flex: none; }
.knowhow-import { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 6px; }

/* 上の帯のアプリの絵（TikTok配信管理） */
header h1 .app-icon { vertical-align: -5px; margin-right: 6px; border-radius: 6px; }
/* 画面全体の透かし（watermark.js） */
.wm { position: fixed; inset: -50%; pointer-events: none; z-index: 9000; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 60px 80px; transform: rotate(-25deg); opacity: .045; font-size: 15px; font-weight: 700; color: #000; user-select: none; -webkit-user-select: none; }
@media (prefers-color-scheme: dark) { .wm { color: #fff; opacity: .06; } }
@media print { .wm { opacity: .10; } }
/* 通知をすすめる一言（ライバーの各機能） */
.push-hint { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, #2f7de1 8%, var(--card)); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.push-hint span { flex: 1 1 220px; }
.push-hint + .button-link, .push-hint + p + .button-link { margin-top: 8px; }

.hb-reports { margin: 6px 0; padding-left: 18px; font-size: 13px; } .hb-reports li { margin: 4px 0; }
.hb-report-row td { padding-top: 0; white-space: normal; } .hb-report-row details { margin: 0 0 6px; }
.hb-facts { margin: 4px 0 8px; } .hb-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; } .hb-facts dt { color: var(--muted, #666); } .hb-facts dd { margin: 0; word-break: break-all; } .hb-history ul { padding-left: 18px; font-size: 12px; }
.leave-date { width: auto; padding: 2px 6px; font-size: 13px; }
#liverSearch { margin: 4px 0 8px; }

/* 配信ごとの様子（管理画面） */
.digest { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.photo-strip figure { margin: 0; font-size: 12px; }
.photo-strip img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; background: #222; display: block; }
.photo-strip figure.has-note img { outline: 3px solid var(--warn); }
.memo-past { border-top: 1px solid var(--line); padding: 4px 0; font-size: 13px; }

/* 今週見るとよい人（管理画面のマネジメント） */
.watch-liver { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.watch-head button { font-weight: 700; }
.watch-liver li { margin: 4px 0; }
.watch-high .flag { background: var(--accent); color: #fff; }

.live-notes li { margin: 6px 0; }
a.button-link.primary-link { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* 通知の記録（管理画面） */
.alert-item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.alert-item.unread { border-color: var(--accent); }
.alert-title { font-weight: 700; margin: 2px 0; }
#tabs button.has-unread { color: var(--accent); font-weight: 700; }
.alert-item .flag { margin-left: 8px; }

/* 話とギフトの動き・お手本（2026-11-25） */
.tag.up { color: var(--ok); border-color: currentColor; }
.tag.down { color: var(--warn); border-color: currentColor; }
.moment .fan-head { gap: 6px; flex-wrap: wrap; }
.feedback { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.clip-video { width: 100%; max-width: 360px; max-height: 480px; background: #000; border-radius: 8px; display: block; margin: 6px 0; }

/* デモ（社内の説明用）の帯 */
.demo-bar { background: #fff3cd; color: #664d03; border-bottom: 1px solid #ffe69c; padding: 8px 16px; font-size: 14px; font-weight: 700; }
@media (prefers-color-scheme: dark) { .demo-bar { background: #332701; color: #ffda6a; border-color: #664d03; } }
#knowhowImportForm .error { white-space: pre-line; }
