/* R31：資料說明一次只顯示一段，設定面板不再超出一屏。 */
.farm-privacy .settings-series-copy { display: none; }
.farm-privacy .settings-series-copy.shown { display: block; }
/* R31：一次只有一個前景層。側邊面板或彈窗開著時，NPC 對話框先收起（關掉面板後若仍在顯示時間內會再出現）。 */
body:has(.side-panel.world-panel-open) #worldDialogue,
body:has(.modal.show) #worldDialogue { display: none !important; }
/* R31：市集未開放時，實際定位的是 .side-body（fixed，上下都有錨點）；桌面取消下錨、手機取消上錨，高度跟著內容。 */
@media (min-width: 860px) {
  .side-panel.world-panel-open .side-body:has(.side-pane.sel .order-market-locked) { bottom: auto !important; height: auto !important; max-height: none !important; }
}
@media (max-width: 859px) {
  .side-panel.world-panel-open .side-body:has(.side-pane.sel .order-market-locked) { top: auto !important; height: auto !important; max-height: none !important; }
}
/* R31：任務標題的步驟名在展開時顯示（「種下作物 2/3」）；收合成一行時只留數字，避免與按鈕重複、被截斷。 */
#questDock .qp-step { font-weight: 600; color: #6b4a1e; }
#questDock.quest-auto-collapsed .qp-step,
#questDock.quest-collapsed .qp-step,
#questDock.quest-target-collapsed .qp-step,
body:has(#worldDialogue:not([hidden])) #questDock .qp-step,
body:has(#toast-zone > .toast) #questDock .qp-step,
body:has(#buildWheel:not([hidden])) #questDock .qp-step { display: none; }
@media (max-width: 859px), (max-height: 600px) { #questDock .qp-step { display: none; } }
/* R31：手機畫面窄，地點標籤會被任務卡蓋成半截；手機上不顯示地點標籤（小地圖與任務卡已說明位置）。 */
@media (max-width: 859px) { .world-location { display: none !important; } }
/* R32 B 線（第 6～10 項）：畫面減量與名牌。只調整版面、定位與顯示規則。 */
/* 6：側放名牌的指向三角——任務標記的 .qpin 留在 NPC 頭頂原位；靠近名牌側放時三角改在靠 NPC 的一側。 */
.qmarker.plate-side-left .npc-nameplate, .qmarker.plate-side-right .npc-nameplate { margin-left: auto; margin-right: auto; }
.npc-nameplate-near.plate-side-right::after { left: -6px; right: auto; bottom: auto; top: 50%; transform: translateY(-50%); border-left: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-right: 6px solid rgba(24, 42, 32, .92); }
.npc-nameplate-near.plate-side-left::after { left: auto; right: -6px; bottom: auto; top: 50%; transform: translateY(-50%); border-right: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 6px solid rgba(24, 42, 32, .92); }
/* 7：方向鍵預設隱藏（設定「顯示方向鍵」開啟後才顯示）；互動鍵無目標時隱藏。 */
html:not(.show-dpad) .dpad { display: none !important; }
html.show-dpad .dpad { display: grid; }
@media (max-width: 859px), (any-pointer: coarse) and (max-height: 480px) { html.show-dpad .mobile-controls { display: block !important; } }
.action-a.r32-interact-hidden { display: none !important; }
/* 7：手機任務卡預設收合後保持一行（標題與進度可見，詳情隱藏）。 */
@media (max-width: 859px), (any-pointer: coarse) and (max-height: 480px) {
  #questDock.quest-collapsed { max-height: 52px; overflow: hidden; }
}
/* 9：面板首屏被收起的卡片與「再顯示 N 項」。 */
.r32-panel-hidden { display: none !important; }
.r32-show-more { display: block; margin: 10px auto 4px; }
.side-pane:has(.r32-show-more) .building-upgrades-head, .side-pane:has(.r32-show-more) .building-upgrade-list { display: none !important; }
@media (max-height: 600px) { .side-pane[data-pane="orders"] .order { padding: 6px 8px; gap: 6px; font-size: 11px; line-height: 1.35; } .side-pane[data-pane="orders"] .order .btn { min-height: 36px; padding: 4px 8px; } .side-pane[data-pane="upgrades"] .up, .side-pane[data-pane="upgrades"] .building-upgrade-card { padding-top: 6px; padding-bottom: 6px; } .side-pane[data-pane="upgrades"] .up .u-desc { font-size: 10px; line-height: 1.35; } .side-pane[data-pane="upgrades"] .up .btn, .side-pane[data-pane="upgrades"] .building-upgrade-card .btn { min-height: 36px; padding-top: 4px; padding-bottom: 4px; } .r32-show-more { min-height: 36px; margin-top: 6px; } }
/* 10：面板標題改一般標題列，不用輸入框樣式（無底色卡片框、無圓角輸入框感）。 */
.pane-head, .side-pane[data-pane="orders"] > .pane-head, .side-panel.world-panel-open .pane-head { background: transparent !important; border: 0 !important; border-bottom: 2px solid #b3874b !important; border-radius: 0 !important; box-shadow: none !important; padding: 4px 2px 8px !important; margin: 0 0 10px !important; text-align: left; }
.modal-card h2, .world-modal h2, .daily-modal-card h2 { background: transparent !important; border: 0; border-bottom: 2px solid #b3874b; border-radius: 0; box-shadow: none; padding: 0 40px 8px 2px; text-align: left; }
/* 10：矮螢幕對話框改上方窄條，高度不超過畫面 20%，不遮田區。 */
@media (max-height: 600px) {
  .world-dialogue, .world-dialogue.dialogue-compact-top { box-sizing: border-box; min-height: 0 !important; top: 8px !important; bottom: auto !important; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 16px)); max-height: 20dvh !important; overflow-y: auto; padding: 8px 12px; }
  .world-dialogue.dialogue-compact-top b { display: inline; margin: 0 8px 0 0; }
  .world-dialogue.dialogue-compact-top p { display: inline; }
  .world-dialogue.dialogue-compact-bottom { top: auto !important; bottom: 8px !important; }
  .world-dialogue.dialogue-compact-top p { font-size: 12px; line-height: 1.45; }
  .world-dialogue.dialogue-compact-top .dialogue-portrait { width: 36px; height: 36px; }
}
/* R32：故事手記裡的「河畔委託」是同一面板的小節，不是第二個面板（不加關閉鈕、不用面板標題樣式）。 */
.story-subhead { margin: 14px 0 6px; padding-top: 10px; border-top: 1px dashed #c9b58a; font-size: 15px; color: #4a3a22; }
/* R32：矮螢幕上方窄條對話，「略過」與「繼續」並排在右側同一列，不再上下錯開。 */
@media (max-height: 600px), (max-width: 859px) {
  .world-dialogue.dialogue-compact-top, .world-dialogue.dialogue-compact-bottom { padding-right: 150px !important; position: fixed; }
  .world-dialogue.dialogue-compact-top .dialogue-close, .world-dialogue.dialogue-compact-bottom .dialogue-close,
  .world-dialogue.dialogue-compact-top .dialogue-continue, .world-dialogue.dialogue-compact-bottom .dialogue-continue {
    position: absolute !important; top: 50% !important; bottom: auto !important; transform: translateY(-50%); height: 32px !important; min-height: 0 !important; padding: 0 10px !important; margin: 0 !important; line-height: 30px; }
  .world-dialogue.dialogue-compact-top .dialogue-close, .world-dialogue.dialogue-compact-bottom .dialogue-close { right: 82px !important; left: auto !important; }
  .world-dialogue.dialogue-compact-top .dialogue-continue, .world-dialogue.dialogue-compact-bottom .dialogue-continue { right: 8px !important; left: auto !important; }
}
