/* ═══════════════════════════════════════════════════════════
   納赫允魔導書 v25 · 樣式表
   ═══════════════════════════════════════════════════════════
   使用 Tailwind CSS（CDN）
   本檔案為自訂樣式（動畫、色彩、Markdown、KaTeX、痕跡之書...）
   ═══════════════════════════════════════════════════════════ */

/* 名字召喚錯誤提示動畫 */
@keyframes nsPulseAlert {
  0%, 100% { box-shadow: 0 0 0 4px rgba(248,113,113,0.15), 0 8px 40px rgba(248,113,113,0.4), 0 0 60px rgba(124,58,237,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(248,113,113,0.25), 0 8px 50px rgba(248,113,113,0.6), 0 0 80px rgba(124,58,237,0.6); }
}

/* 🆕 V25.12 對話 Markdown 訊息樣式 */
.dialogue-md p { margin: 0 0 0.5em 0; }
.dialogue-md p:last-child { margin-bottom: 0; }
.dialogue-md ul, .dialogue-md ol { margin: 0.4em 0; padding-left: 1.4em; }
.dialogue-md li { margin: 0.2em 0; }
/* 🆕 V28.73 語義四色：強調(粗體)＝重要粉紅 */
.dialogue-md strong { color: #f9a8d4; font-weight: 800; text-shadow: 0 0 8px rgba(249,168,212,0.25); letter-spacing: 0.02em; }
/* V28.170 ST 對齊：*斜體敘述* = 灰色斜體（酒館 .mes_text em → --SmartThemeEmColor 預設 rgb(145,145,145)）
   模型寫的 *動作/旁白/氛圍描述* 會像酒館一樣沉下去，和正文、對白拉開層次 */
.dialogue-md em, .dialogue-md i { color: rgb(145,145,145); font-style: italic; font-weight: 400; }
/* ST 對齊：引號內的斜體繼承引號色（酒館 .mes_text q em { color: inherit }） */
.dialogue-md .nh-quote-zh em, .dialogue-md .nh-quote-en em,
.dialogue-md .nh-quote-book em, .dialogue-md q em { color: inherit; }
.dialogue-md strong em, .dialogue-md em strong { color: #fb7185; font-weight: 800; font-style: italic; text-shadow: 0 0 6px rgba(251,113,133,0.3); }
.dialogue-md code { background: rgba(0,0,0,0.5); border: 1px solid rgba(120,120,120,0.3); border-radius: 4px; padding: 0.05em 0.4em; font-size: 0.85em; color: #f9a8d4; font-weight: 800; font-family: ui-monospace, monospace; }
.dialogue-md pre { background: #000; border: 1px solid rgba(120,120,120,0.3); border-radius: 8px; padding: 0.8em 1em; margin: 0.5em 0; overflow-x: auto; }
.dialogue-md pre code { background: transparent; border: none; padding: 0; color: #d4d4d8; font-size: 0.8em; }
.dialogue-md blockquote { border-left: 3px solid rgba(168,85,247,0.5); padding-left: 0.8em; margin: 0.5em 0; color: #a3a3a3; font-style: italic; }
.dialogue-md a { color: #67e8f9; font-weight: 800; text-decoration: underline; }
.dialogue-md hr { border-color: rgba(120,120,120,0.3); margin: 0.8em 0; }
.dialogue-md h1, .dialogue-md h2, .dialogue-md h3, .dialogue-md h4 { font-weight: 700; margin: 0.6em 0 0.3em 0; color: #f4f4f5; }
.dialogue-md h1 { font-size: 1.3em; }
.dialogue-md h2 { font-size: 1.2em; }
.dialogue-md h3 { font-size: 1.1em; }
.dialogue-md table { border-collapse: collapse; margin: 0.5em 0; font-size: 0.9em; width: 100%; }
.dialogue-md th, .dialogue-md td { border: 1px solid rgba(120,120,120,0.3); padding: 0.4em 0.6em; text-align: left; }
.dialogue-md th { background: rgba(60,60,60,0.5); font-weight: 700; color: #fcd34d; }
.dialogue-md tr:nth-child(even) { background: rgba(0,0,0,0.2); }
.dialogue-md .katex { color: #f9a8d4; }
.dialogue-md .katex-display { margin: 0.6em 0; }
.dialogue-md mark { background: rgba(245,158,11,0.4); color: #fde68a; border-radius: 4px; padding: 0 0.2em; }

/* ═══════════════════════════════════════════════════════════
   🆕 V28.73 對話語義四色 — AI／玩家一致，不依說話者分色（見 dialogue-polish.js ensureChatToneStyle）
   分級：白=優先(敘述本文) · 藍(→粉漸層)=次要(對白引號) · 粉紅=重要(強調/重點/code/狀聲) · 黃=警告(！！驚呼)
   說明：renderMessageMarkdown 會自動把以下節奏包成 span：
   - .nh-quote-zh   ：「中文對話引號」 → 次要 藍→粉漸層(約7:3，前半藍後半粉)
   - .nh-quote-en   ："English speech"  → 次要 藍→粉漸層
   - .nh-onomatopoeia：擬聲詞重複        → 由粉接手（重要 粉紅）
   - .nh-quote-book ：『書名／重點』    → 重要 粉紅
   - strong 粗體 **…**                → 重要 粉紅
   - .nh-shout      ：！！警示／驚呼    → 警告 黃
   - .nh-action     ：*星號動作*        → 結構標記 靜謐淡紫（保留，非四色分級）
   - .nh-thought    ：（圓括號內心）    → 結構標記 微暗冷灰（保留，非四色分級）
   ═══════════════════════════════════════════════════════════ */

/* 對白引號：藍→粉 漸層（約 7:3，前半純藍、後半轉粉；只藍轉粉）＋ 粗體 */
.dialogue-md .nh-quote-zh,
.dialogue-md .nh-quote-en {
  background: linear-gradient(90deg, #67e8f9 0%, #67e8f9 50%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #67e8f9;
  font-weight: 800;
  padding: 0 0.05em;
}

.dialogue-md .nh-quote-book {
  color: #f9a8d4;
  font-weight: 800;
  text-shadow: 0 0 5px rgba(249,168,212,0.18);
}

/* V28.170 ST 對齊：星號動作與 em 同步改灰（酒館把 *…* 一律當 em 灰斜體） */
.dialogue-md .nh-action {
  color: rgb(145,145,145);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.015em;
}

.dialogue-md .nh-thought {
  color: #94a3b8;
  font-style: italic;
  font-weight: 300;
  opacity: 0.75;
}

.dialogue-md .nh-shout {
  color: #fde047;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(253,224,71,0.35);
  letter-spacing: 0.05em;
}

.dialogue-md .nh-onomatopoeia {
  color: #f9a8d4;
  font-weight: 800;
  font-style: italic;
  opacity: 1;
  letter-spacing: 0.05em;
}

/* V28.175 直接發音（短／中／長音）固定粉紅；一般 .nh-quote-* 對白維持原藍粉規則。 */
.dialogue-md .nh-vocalization,
.dialogue-md .nh-vocalization .nh-shout {
  color: #f9a8d4;
  -webkit-text-fill-color: #f9a8d4;
  background: none;
  font-weight: 800;
  font-style: italic;
  opacity: 1;
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(249,168,212,0.28);
}

/* 場景／旁白：直書線型（系統或情境訊息中）*/
.dialogue-md .nh-scene {
  color: #c084fc;
  font-style: italic;
  border-left: 2px solid rgba(192,132,252,0.4);
  padding-left: 0.6em;
  margin: 0.3em 0;
  display: inline-block;
}

/* 角色名稱以【】包圍時的特別標示 */
.dialogue-md .nh-name-tag {
  color: #f0abfc;
  font-weight: 800;
  background: rgba(192,38,211,0.12);
  border-radius: 0.3em;
  padding: 0 0.3em;
  letter-spacing: 0.05em;
}

/* V27.10.23 反遞歸警告：偵測到重複時的顯示 */
.dialogue-md .nh-repeat-warn {
  color: #f87171;
  background: rgba(127,29,29,0.3);
  border: 1px dashed rgba(248,113,113,0.4);
  border-radius: 4px;
  padding: 0 0.3em;
  font-size: 0.9em;
}

  @import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@300;400;700;900&display=swap');
  body{font-family:'Noto Serif TC',Georgia,serif;background:#010101;color:#d4d4d8;min-height:100vh;}
  @keyframes spin{100%{transform:rotate(360deg);}}
  @keyframes spin-rev{100%{transform:rotate(-360deg);}}
  @keyframes fadein{from{opacity:0;transform:translateY(20px);}to{opacity:1;transform:translateY(0);}}
  @keyframes zoomin{from{opacity:0;transform:scale(0.9);}to{opacity:1;transform:scale(1);}}
  @keyframes pulseanim{50%{opacity:.5;}}
  @keyframes pinganim{75%,100%{transform:scale(2);opacity:0;}}
  .animate-spin{animation:spin 1s linear infinite;}
  .animate-pulse{animation:pulseanim 2s cubic-bezier(.4,0,.6,1) infinite;}
  .animate-ping{animation:pinganim 2.5s ease-in-out infinite;}
  .fade-in{animation:fadein 1s ease forwards;}
  .zoom-in{animation:zoomin .7s ease forwards;}
  select{-webkit-appearance:none;appearance:none;}
  .custom-scrollbar::-webkit-scrollbar{width:6px;}
  .custom-scrollbar::-webkit-scrollbar-track{background:rgba(0,0,0,.1);border-radius:10px;}
  .custom-scrollbar::-webkit-scrollbar-thumb{background:#27272a;border-radius:10px;}
  .custom-scrollbar::-webkit-scrollbar-thumb:hover{background:#52525b;}
  .svg-cont svg{width:100%;height:100%;overflow:visible;}
  .rich h3{color:#c084fc;font-weight:900;font-size:1.05rem;margin-top:1.8rem;margin-bottom:.9rem;border-bottom:1px solid rgba(168,85,247,.3);padding-bottom:.4rem;letter-spacing:.1em;text-transform:uppercase;}
  .rich blockquote{border-left:3px solid rgba(168,85,247,.6);padding:.75rem 1rem;background:rgba(88,28,135,.2);color:rgba(233,213,255,.8);font-style:italic;margin:1.2rem 0;border-radius:0 .5rem .5rem 0;}
  .rich p{margin-bottom:.9rem;line-height:1.8;color:#d4d4d8;font-weight:300;text-align:justify;}
  .rich strong{color:#f4f4f5;font-weight:700;}
  .rich em{color:#a1a1aa;font-style:italic;}
  /* 🆕 V25.7 截圖增強模式 — html2canvas 不渲染 filter:drop-shadow，所以截圖前換算成可渲染版本 */
  .screenshot-mode [style*="filter:drop-shadow"],
  .screenshot-mode [style*="filter: drop-shadow"]{
    filter: none !important;
    text-shadow: 0 0 4px currentColor, 0 0 8px currentColor !important;
  }
  /* 🆕 V25.7.1 漸層標題（-webkit-background-clip:text）特殊處理 — 保留漸層，僅關閉 drop-shadow */
  .screenshot-mode [style*="background-clip:text"],
  .screenshot-mode [style*="-webkit-background-clip:text"],
  .screenshot-mode [style*="-webkit-background-clip: text"]{
    text-shadow: none !important;
  }
  /* 提亮低對比文字（截圖時太灰看不清楚）*/
  .screenshot-mode .text-zinc-700{ color:#a1a1aa !important; }
  .screenshot-mode .text-zinc-600{ color:#b4b4b8 !important; }
  .screenshot-mode .text-zinc-500{ color:#d4d4d8 !important; }
  .screenshot-mode .text-amber-400\/80{ color:#fcd34d !important; }
  .screenshot-mode .text-amber-400\/70{ color:#fbbf24 !important; }
  .screenshot-mode .text-amber-300\/60{ color:#fcd34d !important; }
  .screenshot-mode .text-amber-300\/80{ color:#fcd34d !important; }
  .screenshot-mode .text-fuchsia-400\/80{ color:#e879f9 !important; }
  .screenshot-mode .text-fuchsia-400\/70{ color:#d946ef !important; }
  .screenshot-mode .text-blue-300\/60{ color:#93c5fd !important; }
  .screenshot-mode .text-blue-300\/80{ color:#93c5fd !important; }
  .screenshot-mode .text-red-300\/60{ color:#fca5a5 !important; }
  .screenshot-mode .text-red-300\/80{ color:#fca5a5 !important; }
  .screenshot-mode .text-purple-400\/80{ color:#c084fc !important; }
  /* 邊框增強對比 */
  .screenshot-mode [class*="border-zinc-800"]{ border-color:#3f3f46 !important; }
  .screenshot-mode [class*="border-zinc-700"]{ border-color:#52525b !important; }
  /* 🆕 SYNERGY 等 box-shadow 紫光 (html2canvas 1.4.1 box-shadow 支援差) — 用 outline + border 模擬 */
  .screenshot-mode [class*="shadow-\\[0_0_20px_rgba\\(168\\,85\\,247"]{
    box-shadow: 0 0 0 2px rgba(168,85,247,0.4) !important;
  }
  /* Q_show 數字補光（用 text-shadow 替代 drop-shadow，但要保有 currentColor 不被 hidden）*/
  .screenshot-mode #cmq-qshow,
  .screenshot-mode #cmq-qfinal{
    filter: none !important;
    text-shadow: 0 0 6px currentColor, 0 0 16px currentColor !important;
  }
  /* 進度條當前 marker dot 加亮 */
  .screenshot-mode #cmq-qshow-marker-dot{
    box-shadow: 0 0 16px currentColor, 0 0 8px currentColor !important;
  }
  /* 🆕 V25.7.1 SVG 法陣保留紫光 (神話法陣等) */
  .screenshot-mode svg [stroke*="rgb(168"], .screenshot-mode svg [fill*="rgb(168"]{
    /* 紫色 stroke/fill 在截圖中保留色彩，無需修改 */
  }
  /* 🆕 V25.7.1 css filter blur 在 html2canvas 也不支援 → 截圖時關掉 */
  .screenshot-mode [style*="filter:blur"],
  .screenshot-mode [style*="filter: blur"]{
    filter: none !important;
  }
  /* 🆕 V25.7.1 確保 R 軸彩色標籤（紅藍橙）保持鮮艷 */
  .screenshot-mode .bg-red-950\/40{ background-color: rgba(127,29,29,0.6) !important; }
  .screenshot-mode .bg-blue-950\/40{ background-color: rgba(30,58,138,0.6) !important; }
  .screenshot-mode .bg-amber-950\/40{ background-color: rgba(120,53,15,0.6) !important; }
  .screenshot-mode .bg-purple-950\/40{ background-color: rgba(76,29,149,0.6) !important; }
  /* safelist */
  .sl{display:none!important;}

/* ═══════════════════════════════════════════════════════════
   V26 統一編輯模式樣式
   ═══════════════════════════════════════════════════════════ */
.editable-block {
  position: relative;
}
.editable-toolbar-wrapper {
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.editable-block:hover .editable-toolbar-wrapper {
  opacity: 1;
  pointer-events: auto;
}
.editable-toolbar {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(120, 120, 120, 0.3);
  border-radius: 6px;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.editable-toolbar button {
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.editable-textarea {
  font-family: 'Noto Sans TC', sans-serif;
  resize: vertical;
}
.editable-textarea:focus {
  outline: none;
  border-color: rgb(217 119 6);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}
.editable-version-badge {
  white-space: nowrap;
}

/* V28.244 正式角色獨白：只渲染回覆中的 <MONOLOGUE>，不承接 provider reasoning。 */
.nh-visible-monologue {
  margin: .65rem 0;
  padding: .65rem .8rem;
  border: 1px solid rgba(139, 92, 246, .34);
  border-left: 3px solid rgba(167, 139, 250, .88);
  border-radius: .55rem;
  background: linear-gradient(135deg, rgba(76, 29, 149, .17), rgba(30, 58, 138, .12));
  color: #ddd6fe;
  box-shadow: inset 0 0 24px rgba(91, 33, 182, .06);
}
.nh-visible-monologue-label {
  display: block;
  margin-bottom: .3rem;
  color: #a78bfa;
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .14em;
}
.nh-visible-monologue-body {
  font-size: .92em;
  font-style: italic;
  line-height: 1.72;
  white-space: normal;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════
   V28.496 視覺小說劇院 · 純手動閱讀／動態立繪／自動場景
   ═══════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════
   V28.659 劇場介面字級。

   信甫圈了四個地方說「太小」：頂端標題列、右上角狀態籌碼、
   字幕上方的說話者列、底部 STORY READER 工具列。量過之後確實 ——
   劇場 chrome 有 33 處字級小於 0.68rem，最小的 0.45rem 大約只有 7px。

   字幕本文早就有自己的縮放（--nh-vn-text-scale，V28.631），但那條只管
   正文，chrome 全部是寫死的 rem —— 放大正文之後反而更不成比例。

   這裡做兩件事：
     ① 抬高地板：所有 <0.9rem 的一律 ×1.18，且不低於 0.78rem。
        （這個 app 的 root font-size 是 14px 不是 16px，0.62rem 只有 8.7px，
         實測還是看不清楚；0.78rem ≈ 11px 才是可讀的地板。）
     ② 全部接上 --nh-vn-ui-scale，讓介面能獨立於正文縮放
        （之後要做成完整的自訂介面，這個變數就是接點）。
   ══════════════════════════════════════════════════ */
.nh-rpg-stage-toolbar{
  position:relative;z-index:8;display:flex;align-items:center;gap:.7rem;min-height:2.8rem;
  padding:.55rem .75rem;border-bottom:1px solid rgba(214,166,91,.2);
  background:linear-gradient(90deg,rgba(30,20,10,.96),rgba(14,13,20,.96) 48%,rgba(16,12,27,.96));
  color:#d6c5a4;box-shadow:inset 0 -1px rgba(255,255,255,.025)
}
.nh-rpg-stage-brand{color:#f0c66f;font-size:calc(0.8rem * var(--nh-vn-ui-scale,1));font-weight:950;letter-spacing:.16em;white-space:nowrap}
.nh-rpg-stage-toolbar-status{min-width:0;overflow:hidden;color:#8f8798;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.nh-rpg-stage-controls{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:.4rem;margin-left:auto}
.nh-rpg-stage-controls button{
  padding:.38rem .62rem;border:1px solid rgba(150,135,165,.26);border-radius:999px;
  background:rgba(4,4,8,.52);color:#aaa2b2;font-size:.65rem;font-weight:850;cursor:pointer;
  transition:transform .12s ease,border-color .18s ease,color .18s ease,background .18s ease
}
.nh-rpg-stage-controls button:hover{border-color:rgba(240,198,111,.58);color:#ffe8ac;background:rgba(120,83,21,.16)}
.nh-rpg-stage-controls button:active{transform:scale(.95)}
.nh-rpg-stage-controls button.is-active{border-color:rgba(240,198,111,.66);background:rgba(120,83,21,.2);color:#ffe5a1;box-shadow:0 0 18px rgba(240,198,111,.08)}
.nh-rpg-stage-controls button:disabled{cursor:not-allowed;opacity:.38}
.nh-rpg-stage-controls .nh-rpg-stage-theater-only[hidden]{display:none!important}

.nh-rpg-stage{
  --nh-rpg-stage-accent:#f0c66f;position:relative;isolation:isolate;display:flex;min-width:0;min-height:0;
  flex:1 1 auto;flex-direction:column;overflow:hidden;border:0;background:#09080c;color:#eee7da
}
.nh-rpg-stage[hidden],.nh-rpg-choice-dock[hidden],.nh-rpg-backlog[hidden]{display:none!important}
.nh-rpg-stage:before{
  content:"";position:absolute;z-index:-3;inset:0;
  background-image:linear-gradient(180deg,rgba(4,5,8,.16),rgba(5,4,8,.28) 52%,rgba(5,4,8,.9)),var(--nh-rpg-scene-image,var(--nh-player-scene-image,none));
  background-position:center;background-size:cover;filter:saturate(.88) contrast(1.06);transform:scale(1.015)
}
.nh-rpg-stage[data-scene-source="illustration"]:before{animation:nh-rpg-stage-scene-in .46s ease both;filter:saturate(.98) contrast(1.08)}
.nh-rpg-stage:after{
  content:"";position:absolute;z-index:-2;inset:0;
  background:radial-gradient(ellipse at 50% 38%,transparent 0 24%,rgba(2,2,5,.12) 60%,rgba(2,2,5,.68) 100%),
    linear-gradient(90deg,rgba(2,2,5,.42),transparent 26% 74%,rgba(2,2,5,.42));
  box-shadow:inset 0 0 120px rgba(0,0,0,.58)
}
.nh-rpg-stage>header{position:absolute;z-index:6;top:0;right:0;left:0;display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding:.8rem 1rem 0;pointer-events:none;text-shadow:0 2px 12px #000}
.nh-rpg-stage>header>div{display:flex;flex-direction:column;min-width:0}
.nh-rpg-stage>header span{color:rgba(240,198,111,.66);font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.18em}
.nh-rpg-stage>header strong{margin-top:.12rem;color:#fff0c9;font-size:.9rem;text-shadow:0 2px 12px #000}
.nh-rpg-stage>header small{padding-top:.18rem;color:#aaa0b0;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));white-space:nowrap}
.nh-rpg-stage-game-hud{position:absolute;z-index:8;top:3rem;right:.8rem;left:.8rem;pointer-events:none}
.nh-rpg-stage-vitals{display:flex;max-width:calc(100% - 1rem);flex-wrap:wrap;justify-content:flex-end;gap:.35rem;margin-left:auto;pointer-events:none}
.nh-rpg-stage-vital{display:flex;min-width:4.5rem;max-width:13rem;flex-direction:column;padding:.32rem .55rem;border:1px solid rgba(255,255,255,.1);border-radius:.5rem;background:rgba(7,6,10,.62);box-shadow:0 6px 18px rgba(0,0,0,.22);backdrop-filter:blur(7px);text-shadow:0 2px 8px #000}
.nh-rpg-stage-vital small{overflow:hidden;color:#8d8393;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.1em;text-overflow:ellipsis;white-space:nowrap}
.nh-rpg-stage-vital strong{overflow:hidden;color:#eee2cb;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.nh-rpg-stage-popover{position:absolute;top:2.9rem;right:0;display:flex;width:min(37rem,calc(100vw - 2rem));max-height:min(69vh,42rem);box-sizing:border-box;flex-direction:column;gap:.65rem;overflow:auto;padding:.85rem;border:1px solid rgba(240,198,111,.36);border-radius:.85rem;background:linear-gradient(145deg,rgba(19,15,23,.97),rgba(7,7,11,.98));color:#d8d0dc;box-shadow:0 24px 70px rgba(0,0,0,.7),inset 0 1px rgba(255,255,255,.04);backdrop-filter:blur(16px);pointer-events:auto;scrollbar-width:thin;scrollbar-color:rgba(240,198,111,.34) transparent}
.nh-rpg-stage-popover[hidden]{display:none!important}
.nh-rpg-stage-popover>header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding-bottom:.58rem;border-bottom:1px solid rgba(240,198,111,.17)}
.nh-rpg-stage-popover>header>div{display:flex;min-width:0;flex-direction:column}
.nh-rpg-stage-popover>header span{color:#aa8d55;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:950;letter-spacing:.16em}
.nh-rpg-stage-popover>header strong{color:#ffe5a4;font-size:calc(1.01rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-stage-popover>header small{color:#817887;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));line-height:1.45}
.nh-rpg-stage-popover>header button{display:flex;width:1.8rem;height:1.8rem;flex:0 0 auto;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.14);border-radius:50%;background:rgba(0,0,0,.25);color:#bdb3c1;cursor:pointer}
.nh-rpg-stage-popover>header button:hover{border-color:#f0c66f;color:#ffe6aa}
.nh-rpg-stage-ai-panel{width:min(42rem,calc(100vw - 2rem))}
.nh-rpg-stage-ai-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(15rem,100%),1fr));gap:.55rem}
.nh-rpg-stage-ai-card{min-width:0;padding:.68rem;border:1px solid rgba(216,180,254,.16);border-radius:.62rem;background:rgba(27,18,34,.55)}
.nh-rpg-stage-ai-card.is-active{border-color:rgba(240,198,111,.52);background:linear-gradient(135deg,rgba(87,58,22,.35),rgba(35,23,43,.62));box-shadow:inset 0 0 18px rgba(240,198,111,.04)}
.nh-rpg-stage-ai-card h3{margin:0 0 .45rem;color:#ead9f0;font-size:calc(0.87rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-stage-ai-card.is-active h3{color:#ffe4a0}
.nh-rpg-stage-state-row{display:grid;grid-template-columns:minmax(4.2rem,.34fr) minmax(0,1fr);gap:.55rem;padding:.24rem 0;border-top:1px solid rgba(255,255,255,.045);font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));line-height:1.45}
.nh-rpg-stage-state-row>span{color:#817786}
.nh-rpg-stage-state-row>strong{min-width:0;color:#d6ccd9;font-weight:650;word-break:break-word}
.nh-rpg-stage-state-empty{margin:.8rem 0;color:#7c7380;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));line-height:1.6}
.nh-rpg-stage-game-menu{width:min(44rem,calc(100vw - 2rem))}
.nh-rpg-stage-game-menu>section{padding:.05rem .05rem .6rem;border-bottom:1px solid rgba(255,255,255,.06)}
.nh-rpg-stage-game-menu>section:last-child{padding-bottom:0;border-bottom:0}
.nh-rpg-stage-game-menu h3{margin:0 0 .42rem;color:#a99cac;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.13em}
.nh-rpg-stage-menu-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:.38rem}
.nh-rpg-stage-menu-buttons>button,.nh-rpg-stage-quick-grid button{padding:.43rem .65rem;border:1px solid rgba(216,180,254,.23);border-radius:.48rem;background:rgba(45,31,54,.62);color:#dcd1e0;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:800;cursor:pointer}
.nh-rpg-stage-menu-buttons>button:hover,.nh-rpg-stage-quick-grid button:hover{border-color:rgba(240,198,111,.58);color:#ffe5a4;background:rgba(95,66,29,.35)}
.nh-rpg-stage-menu-buttons>button.is-primary{border-color:rgba(240,198,111,.48);background:rgba(105,73,25,.36);color:#ffe2a0}
.nh-rpg-stage-menu-buttons>button:disabled{cursor:not-allowed;filter:grayscale(.5);opacity:.42}
.nh-rpg-stage-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.36rem}
.nh-rpg-stage-quick-grid button{min-width:0;padding-inline:.35rem}
.nh-rpg-stage-rounds{display:flex;align-items:center;gap:.4rem;padding:.3rem .48rem;border:1px solid rgba(255,255,255,.11);border-radius:.48rem;background:rgba(0,0,0,.2);color:#a89dad;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-stage-rounds input{width:3.5rem;padding:.24rem .3rem;border:1px solid rgba(240,198,111,.28);border-radius:.32rem;background:#0b0910;color:#ffe2a0;text-align:center}
.nh-rpg-stage-menu-note{color:#817887;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-stage-scene-tools,.nh-rpg-stage-portrait-tools{display:flex;flex-wrap:wrap;gap:.38rem}
.nh-rpg-stage-scene-tools>button,.nh-rpg-stage-portrait-tools>button{padding:.43rem .65rem;border:1px solid rgba(216,180,254,.23);border-radius:.48rem;background:rgba(45,31,54,.62);color:#dcd1e0;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:800;cursor:pointer}
.nh-rpg-stage-scene-tools>button:hover,.nh-rpg-stage-portrait-tools>button:hover{border-color:rgba(240,198,111,.58);color:#ffe5a4;background:rgba(95,66,29,.35)}
.nh-rpg-stage-scene-tools>button.is-primary,.nh-rpg-stage-portrait-tools>button.is-primary{border-color:rgba(240,198,111,.48);background:rgba(105,73,25,.36);color:#ffe2a0}
.nh-rpg-stage-scene-tools>button:disabled,.nh-rpg-stage-portrait-tools>button:disabled{cursor:not-allowed;filter:grayscale(.5);opacity:.42}
.nh-rpg-stage-portrait-editor{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.48rem}
.nh-rpg-stage-portrait-editor>label{display:flex;min-width:0;flex-direction:column;gap:.2rem;color:#93889a;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-stage-portrait-editor>label.is-wide,.nh-rpg-stage-portrait-editor>.nh-rpg-stage-portrait-tools,.nh-rpg-stage-portrait-editor>p{grid-column:1/-1}
.nh-rpg-stage-portrait-editor select,.nh-rpg-stage-portrait-editor input[type="url"]{width:100%;min-width:0;box-sizing:border-box;padding:.46rem .55rem;border:1px solid rgba(216,180,254,.22);border-radius:.42rem;background:#0b0910;color:#e9dff0;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));outline:none}
.nh-rpg-stage-portrait-editor select:focus,.nh-rpg-stage-portrait-editor input[type="url"]:focus{border-color:rgba(240,198,111,.62);box-shadow:0 0 0 2px rgba(240,198,111,.08)}
.nh-rpg-stage-portrait-status{margin:0;color:#c8b9cf;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-stage-context-meter{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}
.nh-rpg-stage-context-meter .nh-rpg-stage-state-row{display:flex;min-width:0;flex-direction:column;gap:.12rem;padding:.42rem;border:1px solid rgba(255,255,255,.07);border-radius:.42rem;background:rgba(0,0,0,.18)}
.nh-rpg-stage-context-meter .nh-rpg-stage-state-row>strong{overflow:hidden;color:#ffe2a0;text-overflow:ellipsis;white-space:nowrap}
.nh-rpg-stage-console{display:contents}
.nh-rpg-stage-actionbar{position:relative;display:flex;min-width:0;align-items:center;gap:.65rem;padding:.34rem .48rem;overflow:hidden;border:1px solid rgba(166,183,211,.2);border-radius:.68rem;background:linear-gradient(96deg,rgba(26,37,56,.64),rgba(22,16,34,.72) 56%,rgba(66,43,19,.42));box-shadow:inset 0 1px rgba(255,255,255,.035),0 8px 24px rgba(0,0,0,.2)}
.nh-rpg-stage-actionbar:before{content:"";position:absolute;inset:0 auto 0 0;width:2px;background:linear-gradient(180deg,transparent,#f0c66f,transparent);opacity:.7}
.nh-rpg-stage-actionbar[hidden]{display:none!important}
.nh-rpg-stage-actionbar-copy{display:flex;min-width:6.5rem;flex:0 0 auto;flex-direction:column;padding-right:.55rem;border-right:1px solid rgba(240,198,111,.16)}
.nh-rpg-stage-actionbar-copy span{color:#a78955;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:950;letter-spacing:.14em}
.nh-rpg-stage-actionbar-copy strong{color:#ffe3a0;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));white-space:nowrap}
.nh-rpg-stage-actionbar-controls{display:flex;min-width:0;flex:1 1 auto;align-items:center;gap:.35rem;overflow-x:auto;scrollbar-width:thin;scrollbar-color:rgba(240,198,111,.25) transparent}
.nh-rpg-stage-actionbar-controls>button{min-height:1.75rem;flex:0 0 auto;padding:.38rem .62rem;border:1px solid rgba(166,183,211,.24);border-radius:.52rem;background:linear-gradient(180deg,rgba(46,54,72,.62),rgba(25,23,36,.72));color:#dcd7e3;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:850;cursor:pointer;white-space:nowrap;box-shadow:inset 0 1px rgba(255,255,255,.035)}
/* V28.631 字級放大鏡：A− / 百分比 / A+ 三件一組，label 不是按鈕，
   給它固定寬度免得數字位數變動時左右按鈕跟著跳。 */
/* ═══════════════════════════════════════════════════════════════════
   V28.632 生成中：執行鍵擋掉，狀態說出來。

   信甫：「選完選項或打字送出選項時，顯示在跑，就不要再把執行跳出來，
           不然會重複執行到；或者還要跳成文字模式看是否有在跑。」

   真正的防呆在 shell.js 的 sendNow（in-flight 直接不受理）；
   這裡是視覺的那一半 —— 讓人一眼看得出來還在跑，不用切回文字模式確認。

   回看前段的按鈕刻意不擋：他要的正是「再跑的期間可以回去前段看內容，
   再回來」。只擋會造成重複送出的那一個鍵。
   ═══════════════════════════════════════════════════════════════════ */
body.naheryu-rpg-generating #dock-execute{pointer-events:none!important;cursor:progress!important;opacity:.55!important;filter:grayscale(.4)!important}
body.naheryu-rpg-generating #dock-execute>span:not(.ico):not(.hint){font-size:0!important}
body.naheryu-rpg-generating #dock-execute>span:not(.ico):not(.hint):after{content:"生成中…";font-size:calc(0.92rem * var(--nh-vn-ui-scale,1));letter-spacing:.05em}
body.naheryu-rpg-generating #dock-execute .hint{visibility:hidden!important}
body.naheryu-rpg-generating #dock-execute .ico{animation:nh-rpg-busy-spin 1.1s linear infinite}
@keyframes nh-rpg-busy-spin{to{transform:rotate(360deg)}}
/* 被擋下時閃一下，讓人知道「按到了，但現在不受理」 */
#dock-execute.is-busy-reject{animation:nh-rpg-busy-reject .4s ease}
@keyframes nh-rpg-busy-reject{0%,100%{transform:none}25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}
/* 生成中也在字幕列掛一個狀態，劇場全螢幕時看得到 */
body.naheryu-rpg-generating .nh-rpg-stage-actionbar-copy>strong:after{content:" · ⏳ 生成中";color:#f0c66f}

/* ═══════════════════════════════════════════════════════════════════
   V28.632 劇場文字上色 —— 把一般對話那一套「複製過去」。

   色碼一個都沒改，只是把 dialogue-polish 那組選擇器
   （原本只認 #dialogue-messages）延伸到劇場字幕。
   標記本身由 renderMessageMarkdown() 產生，見 67-rpg-stage 的 renderCaptionText。

   開關關著時 body 沒有這個 class，字幕走 textContent，完全是舊行為。
   ═══════════════════════════════════════════════════════════════════ */
/* V28.633 劇場模式下 <p> 被包在 .nh-rpg-stage-caption-reader 裡，而且整條規則
   帶 !important。上色的行內元素本身沒被覆蓋，但為了對稱與保險，
   這裡把劇場那條路徑也明寫出來（色碼與下面完全相同）。 */
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p .nh-quote-zh,
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p .nh-quote-en{
  background:linear-gradient(90deg,#67e8f9 0%,#67e8f9 50%,#f9a8d4 100%)!important;
  -webkit-background-clip:text!important;background-clip:text!important;
  -webkit-text-fill-color:transparent!important;color:#67e8f9!important;font-weight:800!important;text-shadow:none!important
}
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p .nh-onomatopoeia{
  color:#f9a8d4!important;-webkit-text-fill-color:#f9a8d4!important;background:none!important;
  font-weight:800!important;font-style:italic!important;text-shadow:0 0 6px rgba(249,168,212,.28)!important
}
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p strong,
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p .nh-quote-book,
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p code{
  color:#f9a8d4!important;font-weight:800!important;text-shadow:0 0 6px rgba(249,168,212,.22)!important
}
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p .nh-shout{
  color:#fde047!important;font-weight:800!important;text-shadow:0 0 8px rgba(253,224,71,.3)!important
}
html body.naheryu-rpg-colored-text.naheryu-rpg-theater .nh-rpg-stage-caption-reader>p em{color:#c4b5fd!important;font-style:italic!important}
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p .nh-quote-zh,
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p .nh-quote-en{
  background:linear-gradient(90deg,#67e8f9 0%,#67e8f9 50%,#f9a8d4 100%);
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:#67e8f9;font-weight:800;text-shadow:none
}
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p .nh-onomatopoeia{
  color:#f9a8d4;-webkit-text-fill-color:#f9a8d4;background:none;
  font-weight:800;font-style:italic;opacity:1;text-shadow:0 0 6px rgba(249,168,212,.28)
}
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p strong,
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p .nh-quote-book,
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p code{
  color:#f9a8d4;font-weight:800;text-shadow:0 0 6px rgba(249,168,212,.22)
}
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p .nh-shout{
  color:#fde047;font-weight:800;text-shadow:0 0 8px rgba(253,224,71,.3)
}
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p em{color:#c4b5fd;font-style:italic}
/* 上色後仍然要能捲動、仍然吃字級縮放（p 的規則在上面，這裡只補行內元素） */
body.naheryu-rpg-colored-text .nh-rpg-stage-caption p span{font-size:inherit;line-height:inherit}

.nh-rpg-vn-scale-label{flex:0 0 auto;min-width:2.9rem;padding:0 .1rem;color:#c8bcd4;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-variant-numeric:tabular-nums;text-align:center;letter-spacing:.04em;user-select:none}
.nh-rpg-stage-actionbar-controls>button:hover{border-color:rgba(240,198,111,.58);background:rgba(95,66,29,.35);color:#ffe5a4}
.nh-rpg-stage-actionbar-controls>button.is-primary{border-color:rgba(240,198,111,.46);background:rgba(105,73,25,.34);color:#ffe2a0}
.nh-rpg-stage-actionbar-controls>button:disabled,.nh-rpg-stage-actionbar-controls input:disabled{cursor:not-allowed;filter:grayscale(.45);opacity:.42}
.nh-rpg-stage-cast{
  position:relative;z-index:1;display:flex;align-items:flex-end;justify-content:center;gap:clamp(.25rem,1.5vw,1.25rem);
  min-width:0;min-height:0;flex:1 1 auto;overflow-x:auto;overflow-y:hidden;padding:2.7rem clamp(.5rem,3vw,2.5rem) 0;
  scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:rgba(240,198,111,.28) transparent
}
.nh-rpg-stage-actor{
  position:relative;display:flex;height:100%;min-width:clamp(11rem,20vw,20rem);max-width:34rem;flex:1 1 0;
  flex-direction:column;align-items:center;justify-content:flex-end;scroll-snap-align:center;
  transform:translateY(2.5%) scale(.92);transform-origin:center bottom;filter:brightness(.66) saturate(.76);
  opacity:.72;transition:transform .32s ease,filter .32s ease,opacity .32s ease
}
.nh-rpg-stage-actor.is-active{z-index:3;transform:translateY(0) scale(1);filter:none;opacity:1}
.nh-rpg-stage-actor.is-active:before{
  content:"";position:absolute;z-index:-1;left:50%;bottom:3rem;width:min(32rem,36vw);height:min(32rem,58vh);transform:translateX(-50%);
  border-radius:50%;background:radial-gradient(circle,rgba(240,198,111,.2),rgba(240,198,111,0) 68%);filter:blur(12px)
}
.nh-rpg-stage-portrait{
  display:flex;width:100%;height:calc(100% - 2.65rem);min-height:13rem;align-items:flex-end;justify-content:center;
  overflow:visible;border:0;border-radius:0;background:transparent;box-shadow:none
}
.nh-rpg-stage-portrait img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 18px 22px rgba(0,0,0,.78));transform-origin:center bottom}
.nh-rpg-stage-portrait>span{display:flex;width:min(18rem,80%);aspect-ratio:3/4;align-items:center;justify-content:center;border:1px solid rgba(240,198,111,.32);border-radius:48% 48% 18% 18%/30% 30% 12% 12%;background:linear-gradient(155deg,rgba(132,103,170,.34),rgba(13,11,18,.86));color:#e9d9ba;font-family:serif;font-size:clamp(3rem,7vw,6rem);font-weight:900;text-shadow:0 3px 18px #000;box-shadow:0 22px 45px rgba(0,0,0,.58)}
.nh-rpg-stage-actor-copy{position:absolute;z-index:4;bottom:.25rem;display:flex;width:max-content;max-width:90%;min-width:7rem;flex-direction:column;align-items:center;padding:.35rem .7rem;text-align:center;text-shadow:0 2px 8px #000;border:1px solid rgba(255,255,255,.1);border-radius:999px;background:rgba(7,6,10,.68);backdrop-filter:blur(8px)}
.nh-rpg-stage-actor-copy small{color:#766f7d;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:950;letter-spacing:.14em}
.nh-rpg-stage-actor.is-active .nh-rpg-stage-actor-copy small{color:var(--nh-rpg-stage-accent)}
.nh-rpg-stage-actor-copy strong{max-width:100%;overflow:hidden;color:#d7d0db;font-size:calc(0.9rem * var(--nh-vn-ui-scale,1));text-overflow:ellipsis;white-space:nowrap}
.nh-rpg-stage-actor.is-active .nh-rpg-stage-actor-copy strong{color:#fff1cc}
.nh-rpg-stage-actor-copy em{display:none}
.nh-rpg-stage-empty{align-self:center;margin:auto;color:#6d6672;font-size:calc(0.85rem * var(--nh-vn-ui-scale,1));letter-spacing:.08em}
.nh-rpg-stage-caption{
  position:relative;z-index:5;display:block;width:100%;min-height:calc(5.25rem * var(--nh-vn-text-scale,1));max-height:min(calc(8.6rem * var(--nh-vn-text-scale,1)),40vh);box-sizing:border-box;
  flex:0 0 auto;margin:.42rem 0 0;padding:.55rem .62rem .4rem;overflow:hidden;border:1px solid rgba(225,190,119,.46);border-radius:.95rem .95rem .7rem .7rem;
  background:linear-gradient(104deg,rgba(5,9,16,.985),rgba(17,15,27,.978) 52%,rgba(30,20,15,.965));box-shadow:0 14px 38px rgba(0,0,0,.58),inset 0 1px rgba(255,255,255,.055),inset 0 0 38px rgba(55,78,111,.08);backdrop-filter:blur(14px)
}
.nh-rpg-stage-caption:before{content:"";position:absolute;top:0;right:9%;left:9%;height:1px;background:linear-gradient(90deg,transparent,rgba(115,157,211,.5),#f0c66f,rgba(115,157,211,.5),transparent);box-shadow:0 0 16px rgba(117,158,213,.28)}
.nh-rpg-stage-caption:after{content:"◇";position:absolute;top:.3rem;right:.6rem;color:rgba(240,198,111,.26);font-size:calc(0.83rem * var(--nh-vn-ui-scale,1));pointer-events:none}
.nh-rpg-stage-caption[hidden]{display:none!important}
.nh-rpg-stage-caption[data-has-next="true"]{cursor:pointer}
.nh-rpg-stage-caption[data-has-next="true"]:hover{border-color:rgba(255,224,154,.68);box-shadow:0 16px 44px rgba(0,0,0,.62),inset 0 0 0 1px rgba(128,164,214,.09),inset 0 0 42px rgba(55,78,111,.1)}
.nh-rpg-stage-caption-head{display:flex;min-width:0;align-items:center;gap:.55rem;padding:0 3.2rem .28rem}
.nh-rpg-stage-caption-head b{max-width:min(55%,28rem);overflow:hidden;color:#ffe3a0;font-size:calc(0.8rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.025em;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 2px 10px #000}
.nh-rpg-stage-caption-head b:before{content:"✦";margin-right:.42rem;color:#8ab4e5;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}
/* V28.646 劇場字幕列的語音導讀鈕 */
.nh-rpg-stage-voice-btn{margin-left:.5rem;padding:.1rem .45rem;border:1px solid rgba(180,140,60,.45);border-radius:.3rem;background:rgba(20,16,10,.6);color:#e8c98a;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.08em;cursor:pointer;transition:all .15s;white-space:nowrap}
.nh-rpg-stage-voice-btn:hover{border-color:rgba(230,190,110,.9);background:rgba(60,44,18,.75);color:#ffe3a0}
.nh-rpg-stage-voice-btn[data-on="true"]{border-color:rgba(240,120,90,.9);background:rgba(90,30,20,.7);color:#ffc2ad}
.nh-rpg-stage-voice-btn[data-idle="true"]{opacity:.4}
.nh-rpg-stage-caption-head span{margin-left:auto;color:rgba(150,168,196,.54);font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.18em}
.nh-rpg-stage-caption-reader{display:grid;min-width:0;grid-template-columns:3rem minmax(0,1fr) 3rem;align-items:stretch;gap:.5rem}
/* V28.631 max-height 跟著字級一起放大：框高寫死的話，放大字只會讓看得到的
   行數變少，等於沒放大。上限用 vh 夾住，免得字幕框吃掉整個畫面。 */
.nh-rpg-stage-caption p{align-self:center;max-height:min(calc(4.6rem * var(--nh-vn-text-scale,1)),34vh);margin:0;overflow:auto;color:#f4efe7;font-size:calc(clamp(.95rem,1.15vw,1.18rem) * var(--nh-vn-text-scale,1));line-height:1.58;white-space:pre-line;word-break:break-word;text-shadow:0 2px 9px rgba(0,0,0,.86);scrollbar-width:thin;scrollbar-color:rgba(240,198,111,.35) transparent}
.nh-rpg-stage-nav{display:flex;min-width:2.75rem;min-height:2.75rem;align-items:center;justify-content:center;gap:.2rem;padding:.2rem;border:1px solid rgba(151,176,210,.24);border-radius:.65rem;background:linear-gradient(160deg,rgba(64,82,108,.3),rgba(12,11,19,.54));color:#d8e4f2;cursor:pointer;box-shadow:inset 0 1px rgba(255,255,255,.04);transition:border-color .18s ease,background .18s ease,transform .12s ease,color .18s ease}
.nh-rpg-stage-nav i{font:400 1.25rem/1 Georgia,serif;color:#f0c66f;text-shadow:0 0 12px rgba(240,198,111,.24)}
.nh-rpg-stage-nav small{display:none;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.08em;white-space:nowrap}
.nh-rpg-stage-nav:hover{border-color:rgba(240,198,111,.6);background:linear-gradient(160deg,rgba(79,100,131,.4),rgba(52,34,23,.6));color:#fff2cf;transform:translateY(-1px)}
.nh-rpg-stage-nav:active{transform:scale(.96)}
.nh-rpg-stage-nav:disabled{cursor:default;filter:grayscale(.45);opacity:.28;transform:none}
.nh-rpg-stage-caption-footer{display:grid;min-height:1rem;grid-template-columns:minmax(5rem,1fr) auto;align-items:center;gap:.65rem;margin-top:.25rem;padding:0 3.2rem;color:#817b89;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));letter-spacing:.055em}
.nh-rpg-stage-progress-rail{height:2px;overflow:hidden;border-radius:999px;background:rgba(136,156,186,.16);box-shadow:inset 0 1px rgba(0,0,0,.35)}
.nh-rpg-stage-progress-rail i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#5b82b2,#f0c66f);box-shadow:0 0 9px rgba(240,198,111,.36);transition:width .25s ease}
@keyframes nh-rpg-stage-next{50%{transform:translateX(.18rem)}}
.nh-rpg-stage[data-mode="worldx"]{--nh-rpg-stage-accent:#7dd3fc}
.nh-rpg-stage[data-mode="worldx"] .nh-rpg-stage-cast{justify-content:space-around}
.nh-rpg-stage[data-mode="group"]{--nh-rpg-stage-accent:#d8b4fe}
.nh-rpg-stage-actor[data-motion="shake"] .nh-rpg-stage-portrait{animation:nh-rpg-stage-shake .42s ease both}
.nh-rpg-stage-actor[data-motion="jump"] .nh-rpg-stage-portrait{animation:nh-rpg-stage-jump .5s ease both}
.nh-rpg-stage-actor[data-motion="pulse"] .nh-rpg-stage-portrait{animation:nh-rpg-stage-pulse .7s ease both}
.nh-rpg-stage-actor[data-motion="enter-left"] .nh-rpg-stage-portrait{animation:nh-rpg-stage-enter-left .45s ease both}
.nh-rpg-stage-actor[data-motion="enter-right"] .nh-rpg-stage-portrait{animation:nh-rpg-stage-enter-right .45s ease both}
.nh-rpg-stage-actor[data-visual-source="caption"] .nh-rpg-stage-portrait img,.nh-rpg-stage-actor[data-visual-source="ai-state"] .nh-rpg-stage-portrait img{animation:nh-rpg-stage-portrait-swap .3s ease both}
@keyframes nh-rpg-stage-scene-in{from{opacity:.2;transform:scale(1.045)}to{opacity:1;transform:scale(1.015)}}
@keyframes nh-rpg-stage-portrait-swap{from{opacity:.35;transform:translateY(.4rem)}to{opacity:1;transform:none}}
@keyframes nh-rpg-stage-shake{20%,60%{transform:translateX(-1.2rem)}40%,80%{transform:translateX(1.2rem)}100%{transform:none}}
@keyframes nh-rpg-stage-jump{45%{transform:translateY(-2.2rem)}100%{transform:none}}
@keyframes nh-rpg-stage-pulse{50%{transform:scale(1.055);filter:brightness(1.14)}100%{transform:none}}
@keyframes nh-rpg-stage-enter-left{from{transform:translateX(-18vw);opacity:0}to{transform:none;opacity:1}}
@keyframes nh-rpg-stage-enter-right{from{transform:translateX(18vw);opacity:0}to{transform:none;opacity:1}}

.nh-rpg-choice-dock{position:relative;z-index:7;flex:0 0 auto;padding:.65rem clamp(.75rem,4vw,3rem) .8rem;border-top:1px solid rgba(216,180,254,.18);background:linear-gradient(180deg,rgba(24,13,33,.96),rgba(8,7,11,.99))}
.nh-rpg-choice-head{display:flex;max-width:60rem;align-items:center;justify-content:space-between;gap:.8rem;margin:0 auto .5rem}
.nh-rpg-choice-head strong{color:#e9d5ff;font-size:calc(.68rem * var(--nh-vn-text-scale,1));letter-spacing:.16em}
.nh-rpg-choice-head small{color:#7d7284;font-size:calc(.62rem * var(--nh-vn-text-scale,1));text-align:right}
.nh-rpg-choice-list{display:grid;max-width:60rem;max-height:29vh;grid-template-columns:1fr;gap:.42rem;margin:auto;overflow:auto;scrollbar-width:thin;scrollbar-color:rgba(240,198,111,.3) transparent}
.nh-rpg-choice-list button{display:grid;grid-template-columns:calc(2.3rem * var(--nh-vn-text-scale,1)) minmax(0,1fr);align-items:center;gap:.8rem;min-width:0;padding:calc(.72rem * var(--nh-vn-text-scale,1)) calc(1rem * var(--nh-vn-text-scale,1));border:1px solid rgba(216,180,254,.3);border-radius:.48rem;background:linear-gradient(90deg,rgba(86,54,103,.72),rgba(52,35,67,.68));color:#f1eaf5;text-align:left;cursor:pointer;box-shadow:inset 0 1px rgba(255,255,255,.035),0 7px 18px rgba(0,0,0,.2);transition:transform .12s ease,border-color .18s ease,background .18s ease}
.nh-rpg-choice-list button:hover{border-color:rgba(255,226,160,.75);background:linear-gradient(90deg,rgba(122,80,141,.82),rgba(75,49,91,.8));transform:translateY(-1px)}
.nh-rpg-choice-list button:active{transform:scale(.985)}
.nh-rpg-choice-list button:disabled{cursor:not-allowed;filter:grayscale(.5);opacity:.45;transform:none}
.nh-rpg-choice-list b{display:flex;align-items:center;justify-content:center;width:calc(2.1rem * var(--nh-vn-text-scale,1));height:calc(2.1rem * var(--nh-vn-text-scale,1));border:1px solid rgba(240,171,252,.38);border-radius:50%;color:#f0abfc;font-size:calc(.84rem * var(--nh-vn-text-scale,1))}
.nh-rpg-choice-list span{min-width:0;color:#f1ebf3;font-size:calc(1.08rem * var(--nh-vn-text-scale,1));line-height:1.5;word-break:break-word}

.nh-rpg-backlog{position:fixed;z-index:10080;inset:0;display:flex;align-items:center;justify-content:center;padding:clamp(.5rem,3vw,2rem);background:rgba(2,2,5,.78);backdrop-filter:blur(10px)}
.nh-rpg-backlog>section{display:flex;width:min(60rem,100%);height:min(48rem,94vh);flex-direction:column;overflow:hidden;border:1px solid rgba(240,198,111,.36);border-radius:1rem;background:linear-gradient(145deg,#111016,#08080b);box-shadow:0 30px 90px rgba(0,0,0,.72)}
.nh-rpg-backlog>section>header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1rem;border-bottom:1px solid rgba(240,198,111,.18);background:rgba(29,21,12,.52)}
.nh-rpg-backlog>section>header>div{display:flex;min-width:0;flex-direction:column}
.nh-rpg-backlog>section>header span{color:#aa8d55;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1));font-weight:900;letter-spacing:.18em}
.nh-rpg-backlog>section>header strong{color:#ffe8af;font-size:.9rem}
.nh-rpg-backlog>section>header small{color:#756d7a;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-backlog-close{display:flex;align-items:center;justify-content:center;width:2.15rem;height:2.15rem;border:1px solid rgba(255,255,255,.16);border-radius:50%;background:rgba(0,0,0,.34);color:#c8bec9;font-size:1.2rem;cursor:pointer}
.nh-rpg-backlog-close:hover{border-color:#f0c66f;color:#ffe8af}
.nh-rpg-backlog-list{flex:1;overflow:auto;padding:1rem clamp(.75rem,3vw,2rem);scrollbar-width:thin;scrollbar-color:rgba(240,198,111,.3) transparent}
.nh-rpg-backlog-entry{padding:.7rem 0;border-bottom:1px solid rgba(255,255,255,.055)}
.nh-rpg-backlog-entry>header{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.32rem}
.nh-rpg-backlog-entry strong{color:#d8b4fe;font-size:calc(0.8rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-backlog-entry.is-user strong{color:#67e8f9}
.nh-rpg-backlog-entry time{color:#5f5964;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}
.nh-rpg-backlog-content{color:#cfc7d2;font-size:calc(0.83rem * var(--nh-vn-ui-scale,1));line-height:1.65;white-space:pre-wrap;word-break:break-word}
.nh-rpg-backlog-empty{margin:4rem auto;color:#746d78;font-size:calc(0.85rem * var(--nh-vn-ui-scale,1))}

body.naheryu-rpg-theater{--nh-rpg-theater-dock-h:clamp(218px,23vh,248px);overflow:hidden!important}
/* result-area 的 fade-in 會留下 transform:matrix(...)，使後代 fixed 被困在中央欄。
   劇院模式先解除這個 containing block，聊天舞台才會真正以 viewport 為基準。 */
body.naheryu-rpg-theater #result-area{transform:none!important;animation:none!important}
/* app-shell 的各區塊是同層 stacking context。劇院只隱藏上方與左右 chrome，
   真正的 BottomDock 直接升到 viewport 上，沿用工作台唯一的送出與設定事件。 */
body.naheryu-rpg-theater #shell-workspace{z-index:10020!important}
body.naheryu-rpg-theater #shell-topbar,
body.naheryu-rpg-theater #shell-leftrail,
body.naheryu-rpg-theater #shell-inspector{visibility:hidden!important;opacity:0!important;pointer-events:none!important}
html body.naheryu-rpg-theater .app-shell.shell-module-dialogue #shell-dock,
html body.naheryu-rpg-theater #shell-dock{position:fixed!important;z-index:10040!important;right:0!important;bottom:0!important;left:0!important;display:flex!important;width:100vw!important;height:var(--nh-rpg-theater-dock-h)!important;min-height:var(--nh-rpg-theater-dock-h)!important;max-height:var(--nh-rpg-theater-dock-h)!important;box-sizing:border-box!important;align-items:stretch!important;flex-wrap:nowrap!important;gap:clamp(.5rem,1vw,.85rem)!important;overflow:visible!important;padding:.55rem clamp(.65rem,2.4vw,2rem)!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;border-top:1px solid rgba(240,198,111,.36)!important;background:linear-gradient(180deg,rgba(14,10,18,.99),rgba(3,3,6,.995))!important;box-shadow:0 -16px 42px rgba(0,0,0,.72)!important}
html body.naheryu-rpg-theater #shell-dock::before{flex-basis:clamp(54px,6vw,88px)!important;margin-right:0!important}
html body.naheryu-rpg-theater #shell-dock .dock-input{display:flex!important;height:100%!important;min-width:0!important;flex-direction:column!important;gap:.32rem!important;overflow:visible!important}
html body.naheryu-rpg-theater #shell-dock .input-row{height:auto!important;min-height:0!important;flex:1 1 auto!important;align-items:stretch!important;gap:.42rem!important;padding:.34rem!important;overflow:visible!important}
html body.naheryu-rpg-theater #shell-dock #dock-attach-btn{align-self:stretch!important;margin:0!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console{display:grid!important;min-width:0!important;min-height:0!important;flex:1 1 auto!important;grid-template-areas:"reader" "controls";grid-template-rows:minmax(0,1fr) auto;align-content:stretch!important;gap:.3rem!important;overflow:hidden!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console>.nh-rpg-stage-caption{grid-area:reader;width:auto!important;height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;padding:.42rem .46rem .3rem!important;border-radius:.82rem!important;box-shadow:inset 0 1px rgba(255,255,255,.045),0 8px 24px rgba(0,0,0,.28)!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-caption-head{padding:0 2.8rem .16rem!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-caption-head>b{font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-caption-reader{min-height:0!important;flex:1 1 auto!important;grid-template-columns:2.85rem minmax(0,1fr) 2.85rem!important;gap:.48rem!important}
/* V28.633 這一條才是劇場實際生效的字級 —— 選擇器帶 html＋body＋#shell-dock，
   又整排 !important，V28.631 改的 .nh-rpg-stage-caption p 完全被它蓋掉。
   信甫回報「140% 跟 100% 都沒變」就是這裡。把縮放乘進來，並讓 overflow
   可捲動（放大後一定會超出，不能讓它直接被截掉）。 */
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-caption-reader>p{display:flex;min-height:0!important;max-height:none!important;align-items:center!important;align-self:stretch!important;overflow:auto!important;padding:.2rem .45rem!important;font-size:calc(clamp(.92rem,1.06vw,1.14rem) * var(--nh-vn-text-scale,1))!important;line-height:1.55!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-nav{min-width:2.75rem!important;min-height:2.75rem!important;border-radius:.5rem!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-caption-footer{min-height:.7rem!important;margin-top:.08rem!important;padding:0 2.8rem!important;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console>.nh-rpg-stage-actionbar{grid-area:controls;min-height:1.8rem!important;gap:.38rem!important;padding:.12rem .32rem!important;border-radius:.52rem!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-actionbar-copy{min-width:5.7rem!important;padding-right:.35rem!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-actionbar-controls>button{min-height:1.65rem!important;padding:.25rem .52rem!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console .nh-rpg-stage-rounds{padding:.18rem .35rem!important}
html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console>#dock-dialogue-input{display:none!important;grid-area:reader;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;box-sizing:border-box!important;padding:.8rem .9rem!important;border:1px solid rgba(225,190,119,.42)!important;border-radius:.82rem!important;background:linear-gradient(104deg,rgba(5,9,16,.985),rgba(17,15,27,.978) 52%,rgba(30,20,15,.965))!important;color:#f4efe7!important;font-size:clamp(.8rem,.94vw,.98rem)!important;line-height:1.55!important;box-shadow:inset 0 1px rgba(255,255,255,.045),0 8px 24px rgba(0,0,0,.28)!important;resize:none!important}
html body.naheryu-rpg-theater #shell-dock .dock-meter{width:clamp(150px,13vw,220px)!important;flex:0 0 auto!important}
html body.naheryu-rpg-theater #shell-dock .dock-execute{width:clamp(92px,8vw,138px)!important;height:auto!important;flex:0 0 auto!important;flex-direction:column!important}
body.naheryu-rpg-theater #dialogue-chat-box{position:fixed!important;z-index:10020!important;top:0!important;right:0!important;bottom:var(--nh-rpg-theater-dock-h)!important;left:0!important;display:flex!important;width:100vw!important;height:auto!important;max-width:none!important;max-height:none!important;margin:0!important;box-sizing:border-box!important;flex-direction:column!important;overflow:hidden!important;border:0!important;border-radius:0!important;background:#060609!important;box-shadow:0 0 0 100vmax rgba(0,0,0,.96)!important}
body.naheryu-rpg-theater #dialogue-chat-box>#dialogue-messages{display:none!important}
body.naheryu-rpg-theater #dialogue-chat-box>.p-4,
body.naheryu-rpg-theater .app-shell.shell-module-dialogue #dialogue-section #dialogue-chat-box>.p-4.border-t.border-zinc-800{display:none!important;visibility:hidden!important;width:0!important;height:0!important;min-width:0!important;min-height:0!important;max-width:0!important;max-height:0!important;padding:0!important;margin:0!important;border:0!important;overflow:hidden!important;pointer-events:none!important}
body.naheryu-rpg-theater.naheryu-rpg-reading #shell-dock .quick-cmds,
body.naheryu-rpg-theater.naheryu-rpg-reading #shell-dock .dock-meter,
body.naheryu-rpg-theater.naheryu-rpg-reading #shell-dock .dock-execute{display:none!important}
body.naheryu-rpg-theater.naheryu-rpg-reading #shell-dock .nh-rpg-stage-console>.nh-rpg-stage-caption{display:flex!important;flex-direction:column!important}
body.naheryu-rpg-theater.naheryu-rpg-composer-ready #shell-dock .nh-rpg-stage-console>.nh-rpg-stage-caption{display:none!important}
body.naheryu-rpg-theater.naheryu-rpg-composer-ready #shell-dock .nh-rpg-stage-console>#dock-dialogue-input{display:block!important}
body.naheryu-rpg-theater .nh-rpg-stage{display:flex!important;flex:1 1 auto!important;max-height:none!important}
body.naheryu-rpg-theater .nh-rpg-stage-cast{height:100%!important;min-height:0!important;box-sizing:border-box!important;align-items:stretch!important;padding:clamp(4.1rem,8.5vh,5.4rem) clamp(.5rem,3vw,2.5rem) clamp(.8rem,1.8vh,1.35rem)!important}
body.naheryu-rpg-theater .nh-rpg-stage-actor{height:auto!important;min-height:0!important;max-height:100%!important;box-sizing:border-box!important;align-self:stretch!important;padding-bottom:.25rem!important;transform:translateY(clamp(-5rem,-7vh,-4rem)) scale(.9)}
body.naheryu-rpg-theater .nh-rpg-stage-actor.is-active{transform:translateY(clamp(-5rem,-7vh,-4rem)) scale(.98)}
body.naheryu-rpg-theater .nh-rpg-stage-portrait{height:auto!important;min-height:0!important;max-height:none!important;flex:1 1 auto!important;overflow:hidden!important}
body.naheryu-rpg-theater .nh-rpg-stage-portrait img{width:auto!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center bottom!important}
body.naheryu-rpg-theater .nh-rpg-stage-portrait>span{width:auto!important;height:100%!important;max-width:80%!important;max-height:100%!important;aspect-ratio:3/4!important}
@media (min-width:701px) and (min-height:860px){
  body.naheryu-rpg-theater .nh-rpg-stage-actor{transform:translateY(clamp(-7.5rem,-12vh,-6rem)) scale(.9)}
  body.naheryu-rpg-theater .nh-rpg-stage-actor.is-active{transform:translateY(clamp(-7.5rem,-12vh,-6rem)) scale(.98)}
}
/* V28.631 信甫：「應該低一點，到胸部到屁股這邊」。舊值 clamp(5.8rem,14vh,9rem)
   把整疊選項貼在畫面最上緣，剛好蓋住立繪的臉。改成以視窗高度為準的
   38vh 起跳（≈ 立繪胸口），上下限用 rem 夾住，矮視窗不會擠到字幕框。 */
body.naheryu-rpg-theater .nh-rpg-choice-dock{position:absolute!important;z-index:12!important;top:clamp(16rem,38vh,26rem)!important;right:0!important;left:0!important;width:100%!important;max-height:48vh!important;box-sizing:border-box!important;padding-inline:clamp(.75rem,8vw,8rem)!important;border:0!important;background:transparent!important;pointer-events:none!important}
body.naheryu-rpg-theater .nh-rpg-choice-head,body.naheryu-rpg-theater .nh-rpg-choice-list{pointer-events:auto!important}
body.naheryu-rpg-theater .nh-rpg-choice-list button{background:linear-gradient(90deg,rgba(80,51,96,.84),rgba(47,32,59,.82))!important;backdrop-filter:blur(9px)!important}
body.naheryu-rpg-theater .nh-rpg-stage-toolbar{flex:0 0 auto}
body.naheryu-rpg-theater #naheryu-player-drawer.nh-player-drawer{z-index:12180!important}
body.naheryu-rpg-theater #naheryu-player-drawer.nh-player-drawer.open{visibility:visible!important;opacity:1!important;pointer-events:auto!important}

@media (max-width:700px){
  .nh-rpg-stage-toolbar{align-items:flex-start;flex-wrap:wrap}.nh-rpg-stage-toolbar-status{order:3;width:100%}.nh-rpg-stage-controls{margin-left:auto}
  .nh-rpg-stage-controls button{padding:.34rem .5rem;font-size:calc(0.78rem * var(--nh-vn-ui-scale,1))}.nh-rpg-stage{min-height:0}
  .nh-rpg-stage-cast{justify-content:flex-start;padding:2.7rem .35rem 0}.nh-rpg-stage-actor{min-width:58vw}.nh-rpg-stage-caption{width:100%;min-height:5.2rem;margin-top:.35rem;padding:.9rem .7rem .38rem}
  .nh-rpg-stage-game-hud{top:4.9rem;right:.4rem;left:.4rem}.nh-rpg-stage-vitals{gap:.2rem}.nh-rpg-stage-vital{display:none}.nh-rpg-stage-vital:first-child,.nh-rpg-stage-vital:nth-child(2){display:flex}
  .nh-rpg-stage-popover{top:.1rem;width:100%;max-height:74vh}.nh-rpg-stage-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.nh-rpg-stage-context-meter{grid-template-columns:1fr}
  .nh-rpg-stage-portrait-editor{grid-template-columns:1fr}.nh-rpg-stage-portrait-editor>label.is-wide,.nh-rpg-stage-portrait-editor>.nh-rpg-stage-portrait-tools,.nh-rpg-stage-portrait-editor>p{grid-column:1}
  .nh-rpg-stage-actionbar{gap:.35rem;padding:.28rem .35rem}.nh-rpg-stage-actionbar-copy{display:none}.nh-rpg-stage-actionbar-controls{gap:.25rem}.nh-rpg-stage-actionbar-controls>button{padding:.34rem .45rem}
  .nh-rpg-stage-caption-head{padding-inline:2.65rem}.nh-rpg-stage-caption-reader{grid-template-columns:2.35rem minmax(0,1fr) 2.35rem;gap:.3rem}.nh-rpg-stage-caption-footer{gap:.3rem;padding-inline:2.65rem}.nh-rpg-stage-caption-footer span{text-align:center}
  .nh-rpg-choice-list{grid-template-columns:1fr}.nh-rpg-choice-head{align-items:flex-start;flex-direction:column;gap:.15rem}.nh-rpg-choice-head small{text-align:left}
  body.naheryu-rpg-theater{--nh-rpg-theater-dock-h:clamp(238px,34vh,286px)}
  html body.naheryu-rpg-theater #shell-dock{gap:.38rem!important;padding:.42rem!important}
  html body.naheryu-rpg-theater #shell-dock::before,html body.naheryu-rpg-theater #shell-dock .dock-meter{display:none!important}
  html body.naheryu-rpg-theater #shell-dock .dock-execute{width:4.6rem!important;min-width:4.6rem!important;font-size:calc(0.83rem * var(--nh-vn-ui-scale,1))!important}
  html body.naheryu-rpg-theater #shell-dock .dock-execute .hint{display:none!important}
  html body.naheryu-rpg-theater #shell-dock .nh-rpg-stage-console{grid-template-rows:minmax(0,1fr) auto}
  body.naheryu-rpg-theater .nh-rpg-stage-actor{transform:translateY(-2rem) scale(.9)}
  body.naheryu-rpg-theater .nh-rpg-stage-actor.is-active{transform:translateY(-2rem) scale(.98)}
}
@media (prefers-reduced-motion:reduce){
  .nh-rpg-stage,.nh-rpg-stage:before,.nh-rpg-stage-actor,.nh-rpg-stage-portrait,.nh-rpg-stage-portrait img,.nh-rpg-stage-controls button,.nh-rpg-choice-list button,.nh-rpg-stage-nav,.nh-rpg-stage-progress-rail i{transition:none!important;animation:none!important}
}
