/* ---------- レビュープレイヤー（RV 相当） ---------- */
body.rp-open .menu, body.rp-open .popover { z-index: 360; }
body.rp-open .modal-back { z-index: 350; }
.player-page { flex: 1; display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 48px); }
.rp { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #111; color: #e6e8eb; font-size: 13px; }
.rp:fullscreen { width: 100vw; height: 100vh; }
.rp-loading, .rp-error { padding: 40px; text-align: center; color: #9aa0a6; }
.rp-error { color: #ff8a80; }
.rp button, .rp select, .rp-pop button, .rp-pop select { background: #2e3137; border: 0; color: #fff; border-radius: 4px; height: 28px; padding: 0 9px; font: inherit; cursor: pointer; }
.rp button:hover, .rp-pop button:hover { background: #3c4047; }
.rp button.on, .rp-pop button.on { background: #2d6fd6; }
.rp button.primary, .rp-pop button.primary { background: #2d8cf0; }
.rp button.danger, .rp-pop button.danger { background: #b3261e; }
.rp button:disabled { opacity: .5; cursor: default; }
.rp .muted { color: #9aa0a6; }
.rp .small { font-size: 11px; }
.rp .spacer { flex: 1; }
.rp-head { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #1d1f22; border-bottom: 1px solid #2e3137; flex-shrink: 0; overflow: hidden; white-space: nowrap; }
.rp-head .pt { color: #9aa0a6; }
.rp-density { display: flex; gap: 4px; margin-bottom: 6px; }
.rp-density button { background: #2a2d33; color: #c9ccd1; border: 1px solid #3a3d44; border-radius: 4px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.rp-density button.on { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.rp-detail { border: 1px solid #33363c; border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; font-size: 12px; }
.rp-detail .row { display: flex; gap: 8px; padding: 1px 0; }
.rp-detail .k { color: #9aa0a6; width: 6.5em; flex: none; }
.rp-detail .v { white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-li-meta { opacity: .85; }
.rp-head .vt { font-weight: 600; font-size: 14px; }
.rp-head .st { padding: 1px 8px; border-radius: 10px; font-size: 11px; color: #111; }
.rp-head .flag { color: #ff9f0a; }
.rp-head .ok { color: #34c759; }
.rp-head .why { color: #cfd6df; font-size: 12px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 2px solid #4da3ff; padding-left: 8px; }
.rp-head .hbtn { background: #2e3137; color: #fff; border-radius: 4px; padding: 4px 10px; text-decoration: none; height: auto; }
.rp-head .close { background: transparent; font-size: 20px; }
.rp-main { flex: 1; display: flex; min-height: 0; }
.rp-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rp-viewer { flex: 1; position: relative; background: #000; min-height: 120px; overflow: hidden; user-select: none; }
.rp-canvas, .rp-overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rp-overlay { pointer-events: none; }
.rp-slate { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: repeating-linear-gradient(45deg, #1a1a1a 0 14px, #202020 14px 28px); color: #ff9b8f; font-size: 15px; }
.rp-slate[hidden] { display: none; }
.rp-slate .sc { font-size: 22px; font-weight: 600; color: #fff; }
.rp-hud { position: absolute; left: 8px; top: 6px; font-size: 12px; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 4px; pointer-events: none; font-variant-numeric: tabular-nums; }
.rp-hud .warn { color: #ffcc00; }
.rp-pixel { position: absolute; left: 8px; bottom: 6px; font-size: 11px; background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 4px; pointer-events: none; font-family: ui-monospace, Consolas, monospace; }
.rp-banner { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); padding: 4px 14px; border-radius: 14px; font-size: 12px; background: rgba(45,111,214,.9); pointer-events: none; }
.rp-banner.warn { background: rgba(179,38,30,.92); }
.rp-banner.ok { background: rgba(52,199,89,.9); color: #111; }
.rp-banner[hidden] { display: none; }
.anno-text-input { position: absolute; z-index: 5; background: rgba(0,0,0,.55); border: 1px dashed #fff; border-radius: 3px; padding: 0 2px; margin: -1px 0 0 -3px; font: 600 16px system-ui, sans-serif; min-width: 160px; resize: none; overflow: hidden; outline: none; white-space: pre-wrap; field-sizing: content; }
.rp-annobar { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: #26292e; border-top: 1px solid #3a3d43; flex-wrap: wrap; }
.rp-annobar[hidden] { display: none; }
.rp-annobar .lbl { color: #ffcc00; font-weight: 600; }
.rp-annobar .grp { display: inline-flex; gap: 4px; align-items: center; }
.rp-annobar .sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #555; cursor: pointer; }
.rp-annobar .sw.on { border-color: #fff; }
.rp-annobar .lw { display: inline-block; width: 16px; background: #fff; border-radius: 2px; vertical-align: middle; }
.rp-transport { display: flex; align-items: center; gap: 5px; padding: 5px 10px; background: #1d1f22; flex-wrap: wrap; }
.rp-transport .play { min-width: 40px; font-size: 15px; }
.rp-transport .rp-frame { min-width: 170px; text-align: left; font-variant-numeric: tabular-nums; background: #16181b; }
.rp-transport .rp-frame b { font-size: 14px; }
.rp-transport .vol { width: 70px; }
.rp-tlwrap { position: relative; background: #16181b; border-top: 1px solid #2e3137; }
.rp-timeline { display: block; width: 100%; height: 64px; cursor: pointer; touch-action: none; }
.rp-tltip { position: absolute; bottom: 66px; background: #000; color: #fff; padding: 2px 8px; border-radius: 3px; font-size: 11px; pointer-events: none; white-space: nowrap; }
.rp-tltip[hidden] { display: none; }
.rp-side { width: 360px; flex-shrink: 0; background: #1d1f22; border-left: 1px solid #2e3137; display: flex; flex-direction: column; min-height: 0; }
.rp-tabs { display: flex; border-bottom: 1px solid #2e3137; }
.rp .rp-tabs button { flex: 1; background: transparent; border-radius: 0; height: 36px; color: #c9ccd1; border-bottom: 2px solid transparent; }
.rp .rp-tabs button.on { color: #fff; border-bottom-color: #4da3ff; background: transparent; }
.rp-sbody { flex: 1; overflow: auto; padding: 10px; }
.rp-composer { background: #26292e; border: 1px solid #3a3d43; border-radius: 6px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.rp-composer textarea, .rp-composer input, .rp-sync input { width: 100%; box-sizing: border-box; background: #16181b; color: #fff; border: 1px solid #3a3d43; border-radius: 4px; padding: 6px 8px; font: inherit; }
.rp-composer textarea { min-height: 70px; resize: vertical; }
.rp-composer .row, .rp-sync .row, .rp-colorpanel .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rp .chip { background: #16181b; border: 1px solid #3a3d43; border-radius: 10px; padding: 1px 8px; font-size: 11px; height: auto; }
/* フレーム番号: 桁が増えても幅が変わらないように、等幅の数字にして、幅は player.js がいちばん大きい番号の桁数ぶん取る */
.rp .chip .rp-fnum { display: inline-block; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-composer .chip { white-space: nowrap; flex: none; }
/* ノート欄のいちばん下の行: 幅を先に取ったフレーム番号（4 桁まで）と 3 つのボタンが 1 行に収まるように、すき間を少し詰める。
   「ノートを保存」は右端に寄せる（すき間用の空の要素は使わない） */
.rp-composer .row { gap: 4px; }
.rp-composer .row .chip { padding: 1px 6px; }
.rp-composer .row .spacer { display: none; }
.rp-composer .row .primary { margin-left: auto; }
.rp-err { background: #3b1d1b; color: #ffb4ab; border-radius: 4px; padding: 6px 8px; font-size: 12px; }
.rp-err[hidden] { display: none; }
.rp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rp-note { background: #26292e; border: 1px solid #33363c; border-radius: 6px; padding: 7px 9px; margin-bottom: 7px; }
.rp-note.hl { border-color: #ffcc00; }
.rp-note .nh { display: flex; gap: 6px; align-items: center; margin-bottom: 3px; }
.rp-note .ann { color: #ffcc00; }
.rp-note .nb { white-space: pre-wrap; word-break: break-word; }
.rp-note .nf { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.rp-note .nf img { height: 60px; border-radius: 3px; }
.rp-note .nr { margin-top: 6px; padding-left: 9px; border-left: 2px solid #3a3e45; display: flex; flex-direction: column; gap: 5px; }
.rp-note .nrc textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.rp-note .nrc .row { display: flex; margin-top: 3px; }
.rp-note .nrc .spacer { flex: 1; }
.rp-li { display: flex; gap: 8px; padding: 6px; border-radius: 5px; cursor: pointer; align-items: center; }
.rp-li:hover { background: #26292e; }
.rp-li.on { background: #2f4a6b; }
.rp-cut { background: #3a3350; color: #e6dcff; border-radius: 4px; padding: 1px 8px; white-space: nowrap; }
.rp-pin { cursor: default; }
.rp-warn { background: #5a4310; color: #ffe2a6; border-radius: 4px; padding: 1px 8px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-cut-sel { background: #26292e; color: inherit; border: 1px solid #3a3e45; border-radius: 4px; padding: 2px 4px; max-width: 150px; }
.rp-li img, .rp-li .ph { width: 80px; height: 45px; object-fit: cover; background: #2e3137; border-radius: 3px; flex-shrink: 0; }
.rp-li .c { word-break: break-all; }
.rp-li .bad { color: #ff9b8f; font-size: 11px; }
.rp-li.unviewed .c::before { content: "●"; color: #2f80ed; font-size: 9px; margin-right: 4px; vertical-align: middle; }
.rp-info .row { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid #2e3137; }
.rp-info .k { width: 110px; flex-shrink: 0; color: #9aa0a6; }
.rp-info .v { flex: 1; min-width: 0; word-break: break-word; }
.rp-info .v.editable { cursor: pointer; border-radius: 3px; }
.rp-info .v.editable:hover { background: #2e3137; }
.rp-info .v.editing input, .rp-info .v.editing select, .rp-info .v.editing textarea { background: #16181b; color: #fff; }
.rp-info a { color: #8ab4f8; }
.rp-sync { display: flex; flex-direction: column; gap: 8px; }
.rp-sync .ttl, .rp-colorpanel .ttl, .rp-help .ttl { font-weight: 600; margin-top: 4px; }
.rp-sync .share { display: flex; gap: 6px; }
.rp-sync .pp { display: flex; gap: 6px; align-items: center; }
.rp-sync .pp .dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; }
.rp-sync .pp.off .dot { background: #666; }
.rp-sync .tag { font-size: 10px; background: #2d6fd6; border-radius: 8px; padding: 0 6px; }
.rp-sync .tag.g { background: #5f5f5f; }
.rp-sync .tag.w { background: #b07a00; }
.popover.rp-pop { background: #1d1f22; color: #e6e8eb; border-color: #3a3d43; }
.rp-colorpanel { display: flex; flex-direction: column; gap: 8px; min-width: 300px; }
.rp-colorpanel .crow { display: flex; gap: 8px; align-items: center; }
.rp-colorpanel .crow .k { width: 90px; color: #9aa0a6; }
.rp-colorpanel .crow input[type=range] { flex: 1; }
.rp-colorpanel .crow .v { width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.rp-colorpanel select { flex: 1; }
.rp-colorpanel .muted { color: #9aa0a6; }
.rp-help table { border-collapse: collapse; }
.rp-help td { padding: 2px 10px 2px 0; }
.rp-help td.k { color: #ffcc00; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.rp-inline .rp-side { width: 320px; }
@media (max-width: 900px) {
  .rp-main { flex-direction: column; }
  .rp-side { width: auto; height: 40vh; border-left: 0; border-top: 1px solid #2e3137; }
  .rp-viewer { min-height: 40vh; }
}

/* ---------- レポート（印刷して PDF に） ---------- */
.report-page { padding: 20px 28px; overflow: auto; flex: 1; background: #fff; color: #222; }
.rep-head h1 { margin: 0 0 4px; font-size: 22px; }
.rep-tools { display: flex; gap: 8px; align-items: center; margin: 10px 0 18px; }
.rep-ver { border-top: 2px solid #222; padding: 12px 0; }
.rep-vh { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; break-after: avoid; page-break-after: avoid; }
.rep-vh .thumb { width: 160px; border-radius: 3px; }
.rep-vh h2 { margin: 0 0 2px; font-size: 16px; }
.rep-vh .st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; margin-top: 4px; }
.rep-vh .ok { color: #1b873f; }
.rep-note { padding: 8px 0 10px 12px; border-left: 3px solid #d0d4da; margin: 0 0 8px; break-inside: avoid; }
.rep-meta { display: flex; gap: 10px; font-size: 12px; margin-bottom: 3px; }
.rep-text { white-space: pre-wrap; }
.rep-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.rep-imgs img, .rep-imgs canvas { max-width: 420px; max-height: 260px; border: 1px solid #ccc; }
.rep-none { padding: 4px 0 4px 12px; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body * { visibility: hidden; }
  .report-page, .report-page * { visibility: visible; }
  .report-page { position: absolute; left: 0; top: 0; width: 100%; padding: 0; overflow: visible; font-size: 10pt; }
  .noprint { display: none !important; }
  /* 見出しだけのページを作らない。バージョンの見出しは最初のノートと同じページに置く */
  .rep-head { break-after: avoid; page-break-after: avoid; margin-bottom: 4mm; }
  .rep-head h1 { font-size: 16pt; }
  .rep-ver { padding: 3mm 0; }
  .rep-vh { margin-bottom: 2mm; }
  .rep-vh .thumb { width: 40mm; }
  .rep-vh h2 { font-size: 12pt; }
  /* ノート 1 件（文と画像）が A4 横 1 ページに収まる大きさ。画像は 2 列で並べる */
  .rep-note { break-inside: avoid; page-break-inside: avoid; padding: 2mm 0 2mm 3mm; margin-bottom: 3mm; }
  .rep-imgs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3mm; }
  .rep-imgs img, .rep-imgs canvas { width: 100%; height: auto; max-width: none; max-height: 50mm; object-fit: contain; }
  .rep-imgs > :only-child { grid-column: 1 / -1; max-height: 100mm; }
}

/* 静止画のプレビュー: 再生の操作・タイムライン・フレーム番号を出さない（Flow の静止画ビューアと同じ） */
.rp-transport .rp-pb { display: contents; }
.rp-still .rp-transport .rp-pb, .rp-still .rp-tlwrap, .rp-still .rp-hud .muted:nth-child(2), .rp-still .rp-composer .chip { display: none; }
.rp-transport .rp-stilltag { font-size: 11px; color: #9aa0a8; border: 1px solid #3a3e45; border-radius: 3px; padding: 1px 6px; }

/* 送る前の注釈（フレームごと）と添付の一覧 */
.rp-drafts { display: flex; flex-wrap: wrap; gap: 4px; }
.rp-drafts[hidden] { display: none; }
.rp-drafts .dchip { display: inline-flex; align-items: center; max-width: 100%; background: #16181b; border: 1px solid #3a3d43; border-radius: 10px; font-size: 11px; color: #d7dade; overflow: hidden; }
.rp-drafts .dchip.ann { border-color: #8a7a2e; }
.rp-drafts .dchip .go, .rp-drafts .dchip .nm { background: transparent; border: 0; color: inherit; padding: 2px 4px 2px 8px; font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.rp-drafts .dchip .go { cursor: pointer; }
.rp-drafts .dchip .x { background: transparent; border: 0; color: #9aa0a6; padding: 2px 7px 2px 3px; cursor: pointer; font: inherit; }
.rp-drafts .dchip .x:hover { color: #ff7b72; }
.rp-composer.drop { outline: 2px dashed #1ea7fd; outline-offset: 2px; }
.rp-note .nfl { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 11px; }
.rp-note .nfl a { color: #7fb8ff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.rp-info-head { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; }
.rp-info-head .spacer { flex: 1; }
.rp-info-none { padding: 8px 0 12px; }
.rp-info-at { margin: 4px 0 12px; }
.rp-media-info { border-bottom: 1px solid #33363c; margin-bottom: 8px; }
.rp-related-toggle { display: flex; align-items: center; gap: 6px; margin: 6px 0; color: #c9ccd1; font-size: 12px; cursor: pointer; }
.rp-related { margin-top: 10px; border-top: 1px solid #33363c; padding-top: 8px; }
.rp-related-head { color: #9aa0a6; font-size: 11px; margin-bottom: 6px; }
.rp-related-ver { font-weight: 600; margin: 8px 0 4px; }
.rp-note.related { opacity: .9; border-style: dashed; }
/* Version Selector（Alt+V） */
.rp-vs { display: flex; flex-direction: column; gap: 8px; width: min(620px, 92vw); }
.rp-vs .ttl { font-weight: 600; }
.rp-vs .muted { color: #9aa0a6; }
.rp-vs .small { font-size: 11px; }
.rp-vs .spacer { flex: 1; }
.rp-vs-bar { display: flex; gap: 6px; }
.rp-vs-q { flex: 1; min-width: 0; height: 28px; background: #121315; color: #e6e8eb; border: 1px solid #3a3d43; border-radius: 4px; padding: 0 8px; font: inherit; }
.rp-vs-q:focus { outline: 2px solid #2d8cf0; outline-offset: -1px; }
.rp-vs-steps { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rp-vs-steps:empty { display: none; }
.rp-vs-steps button { height: 22px; font-size: 12px; }
.rp-vs-list { max-height: min(50vh, 420px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.rp-vs-row { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 5px; cursor: pointer; border: 1px solid transparent; }
.rp-vs-row:hover { background: #26292e; }
.rp-vs-row.sel { background: #2f4a6b; border-color: #2d8cf0; }
.rp-vs-row img, .rp-vs-row .ph { width: 64px; height: 36px; object-fit: cover; background: #2e3137; border-radius: 3px; flex-shrink: 0; }
.rp-vs-row .tx { flex: 1; min-width: 0; }
.rp-vs-row .c { word-break: break-all; }
.rp-vs-row .tag { font-size: 10px; background: #2d6fd6; border-radius: 8px; padding: 0 6px; margin-left: 6px; white-space: nowrap; }
.rp-vs-row .tag.dim { background: #5f5f5f; }
.rp-vs-st { font-size: 11px; border-radius: 3px; padding: 1px 6px; color: #fff; white-space: nowrap; text-shadow: 0 0 2px rgba(0,0,0,.6); }
.rp-vs-act { display: flex; gap: 4px; flex-shrink: 0; }
.rp-vs-act button { height: 24px; font-size: 12px; padding: 0 7px; }
.rp-vs-foot { display: flex; gap: 8px; }
.rp-vs-none { padding: 16px; text-align: center; }

/* G61: Flow の d（右のパネル）と shift+f（再生の操作）で隠す。キーの割り当ての選択 */
.rp-noside .rp-side { display: none; }
.rp-nocontrols .rp-transport, .rp-nocontrols .rp-tlwrap { display: none; }
.rp-keymap-row { display: block; margin: 6px 0; }
.rp-keymap-row select { background: #2a2d32; color: inherit; border: 1px solid #3a3d44; border-radius: 4px; padding: 2px 6px; }

/* G59: 注釈の道具（太さと不透明度のスライダー、枠 / 塗り、文字の書式） */
.rp-annobar input[type=range] { width: 90px; accent-color: #ffcc00; }
.rp-annobar .val { min-width: 2.6em; color: #c9ccd1; font-size: 12px; font-variant-numeric: tabular-nums; }
.rp-annobar .lbl2 { color: #9aa0a8; font-size: 12px; }
.rp-annobar .grp[hidden] { display: none; }
.rp-annobar .rp-anno-color { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.rp-annobar select { background: #2a2d32; color: inherit; border: 1px solid #3a3d44; border-radius: 4px; padding: 2px 4px; }
.rp-annobar .tb { font-weight: 700; }
.rp-annobar .ti { font-style: italic; }
.rp-annobar .tu { text-decoration: underline; }
