/* Reading surfaces must grow with translated content, not crop it to carousel slots.
   Scoped IDs intentionally supersede the retained classic/portrait layout rules. */
html[data-layout] body {min-width:0}
/* Keep the stage summary and its controls reachable with long translations
   and 200% text; do not change the palm scene or its overlay coordinates. */
body .theatre-heading{flex-wrap:wrap}
body .theatre-heading>div{min-width:0;max-width:100%;overflow-wrap:anywhere}
body .theatre-heading .theatre-heading__tools{flex-wrap:wrap}
body .theatre-heading :is(#guideMode,button){min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
body .site-header .brand small,body .theatre-heading .theatre-kicker,
body #questNumber,body #questLabel,body #palmChat .palm-chat__head>div>span,
body #baziSummary {font-size:12px;line-height:1.6;white-space:normal;overflow-wrap:anywhere}
body.has-hand #discoveryList {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-template-rows:none!important;
  grid-auto-flow:row!important;
  grid-auto-columns:auto;
  max-height:none!important;
  overflow:visible!important;
  gap:14px;
  padding:3px;
  cursor:auto;
  scroll-snap-type:none;
}
body.has-hand #discoveryList[hidden], body #interpretationOrbit[hidden] {display:none!important}
body.chat-active #discoveryPanel::before {content:"本次匹配内容 · 选择卡片查看"}
html:lang(ja) body.chat-active #discoveryPanel::before {content:"今回の一致項目 · カードを選んで確認"}
html:lang(en) body.chat-active #discoveryPanel::before {content:"Matched features · Select a card to explore"}
body.has-hand #discoveryList .discovery-item {
  height:auto;min-height:0;min-width:0;max-width:100%;
  padding:16px;gap:10px;overflow:visible;
  overflow-wrap:anywhere;white-space:normal;align-self:stretch;
  opacity:1;filter:none;
}
body.has-hand #discoveryList .discovery-item > * {flex-shrink:0;min-width:0}
body.has-hand #discoveryList .discovery-item::after {right:4px;bottom:4px;pointer-events:none}
body.has-hand #discoveryList .discovery-item > strong {
  font-size:18px;line-height:1.5;white-space:normal;overflow:visible;
}
body.has-hand #discoveryList .discovery-item > small {
  display:block;-webkit-line-clamp:unset;line-clamp:unset;
  overflow:visible;font-size:15px;line-height:1.75;
}
body.has-hand #discoveryList .discovery-card__top {
  display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px;
}
body.has-hand #discoveryList .discovery-card__top b {
  flex:1 1 140px;max-width:100%;font-size:13px;line-height:1.6;
}
body.has-hand #discoveryList .discovery-card__top em {
  max-width:100%;white-space:normal;font-size:12px;line-height:1.6;
}
/* Keep all four reading entry points next to the image, but out of its overlays. */
body.has-hand #interpretationOrbit {
  position:relative;inset:auto;order:2;display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;
  width:100%;min-width:0;padding:16px;box-sizing:border-box;pointer-events:auto;
}
body.has-hand #interpretationOrbit .interpretation-rail {display:contents}
body.has-hand #interpretationOrbit .interpretation-card {
  grid-row:auto!important;width:100%;height:auto;min-height:0;
  padding:16px;gap:8px;overflow:visible;overflow-wrap:anywhere;
}
body.has-hand #interpretationOrbit .interpretation-card > * {flex-shrink:0;min-width:0}
body.has-hand #interpretationOrbit .interpretation-card strong {
  font-size:18px;line-height:1.5;white-space:normal;overflow:visible;text-overflow:clip;
  display:block;-webkit-line-clamp:unset;
}
body.has-hand #interpretationOrbit .interpretation-card p {
  display:block;overflow:visible;-webkit-line-clamp:unset;font-size:16px;line-height:1.75;
}
body.has-hand #interpretationOrbit .interpretation-card :is(span,i) {font-size:13px;line-height:1.6}
body #interpretationDialog {
  width:min(1180px,96vw);max-width:96vw;height:92vh;height:92svh;
  max-height:92svh;box-sizing:border-box;
}
body #interpretationDialog .interpretation-dialog__head {flex:0 0 auto;position:relative;padding:16px;gap:12px}
body #interpretationDialog .interpretation-dialog__head > div {min-width:0;overflow-wrap:anywhere}
body #interpretationDialog .interpretation-dialog__head span {font-size:13px;line-height:1.5}
body #interpretationDialog .interpretation-dialog__head h2 {font-size:20px;line-height:1.5;overflow-wrap:anywhere}
body #closeInterpretation {flex:0 0 44px;min-width:44px;min-height:44px;margin:0}
body #interpretationDialog .interpretation-dialog__body {height:auto!important;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}
body #interpretationDialog .interpretation-dialog__next {flex:0 0 auto;min-height:0;padding:14px 16px;gap:10px}
body #interpretationDialog :is(.interpretation-group__title small,.interpretation-insight-card footer,.interpretation-dialog__next span) {font-size:13px;line-height:1.6}
body #interpretationDialog .interpretation-insight-card > span {font-size:13px}
body #interpretationDialog .interpretation-insight-card h3 {overflow-wrap:anywhere}
body #interpretationDialog :is(.interpretation-summary>span,.interpretation-combined>span,#interpretationChatButton) {font-size:13px;line-height:1.6}
body .palm-chat__message {min-width:0;overflow-wrap:anywhere}
body .palm-chat__message :is(p,.palm-chat__message-text) {font-size:16px;line-height:1.75}
body #interpretationDialog .interpretation-advice p {font-size:16px;line-height:1.75;overflow-wrap:anywhere}
body #interpretationDialog .interpretation-advice small {font-size:14px;line-height:1.75;overflow-wrap:anywhere}
html[data-palm-theme="paper"] body .palm-chat__message--assistant {background:#f8f5ee!important;color:#282334!important}
html[data-palm-theme="paper"] body .palm-chat__message--assistant :is(.palm-chat__message-copy,.palm-chat__message-text,p) {color:#282334!important;opacity:1}
html[data-palm-theme="moon"] body .palm-chat__message--assistant {background:#20172c!important;color:#f1eaf7!important}
html[data-palm-theme="moon"] body .palm-chat__message--assistant :is(.palm-chat__message-copy,.palm-chat__message-text,p) {color:#f1eaf7!important;opacity:1}
@media(max-width:700px) {
  body.has-hand #discoveryList,body.has-hand #interpretationOrbit {grid-template-columns:minmax(0,1fr)!important}
  body.has-hand #interpretationOrbit {padding:12px 0}
  body.has-hand #discoveryList .discovery-item {padding:14px}
  body #interpretationDialog .interpretation-dialog__head h2 {font-size:18px}
}
@media(max-height:500px) {
  /* On short landscape screens header, body and footer share one reachable scrollport. */
  body #interpretationDialog {overflow:auto}
  body #interpretationDialog .interpretation-dialog__body {overflow:visible;flex:0 0 auto}
  body #interpretationDialog .interpretation-dialog__head {position:static}
}
/* Restore the historical palm-story.css / 9afe0c5 overlay geometry.
   Only landscape viewports use it, irrespective of the presentation toggle. */
@media (orientation:landscape) {
html[data-layout] body.has-hand .story-stage-wrap {display:block;position:relative}
html[data-layout] body.has-hand #palmStage {width:100%;min-width:0;height:78vh;min-height:650px;max-height:1000px}
html[data-layout] body.has-hand #interpretationOrbit {
  position:absolute;inset:18px;z-index:8;display:block;
  width:auto;padding:0;pointer-events:none;
}
html[data-layout] body.has-hand #interpretationOrbit[hidden] {display:none!important}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-rail {
  position:absolute;top:38px;bottom:44px;width:clamp(190px,19vw,285px);
  max-width:calc(50% - 24px);min-width:0;
  display:grid;grid-template-rows:repeat(5,minmax(0,1fr));gap:9px;
}
html[data-layout] body.has-hand #interpretationLeft {left:18px;right:auto}
html[data-layout] body.has-hand #interpretationRight {right:18px;left:auto}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-card {
  grid-row:auto!important;pointer-events:auto;
  min-width:0;min-height:0;width:100%;height:auto;
  padding:8px 12px;gap:2px;overflow:hidden;cursor:pointer;
}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-card strong {
  font-size:14px;line-height:1.35;display:-webkit-box;white-space:normal;
  -webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;
}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-card p {
  font-size:12px;line-height:1.5;display:-webkit-box;-webkit-box-orient:vertical;
  -webkit-line-clamp:1;overflow:hidden;
}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-card span {font-size:12px;line-height:1.5}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-card i {font-size:12px;line-height:1.5}
html[data-layout] body.has-hand .palm-theatre.is-stage-collapsed .story-stage-wrap {display:none}
}
@media (orientation:landscape) and (max-width:900px) {
html[data-layout] body.has-hand #interpretationOrbit {inset:8px}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-rail {width:31vw;max-width:calc(50% - 12px);top:20px;bottom:36px;gap:6px}
html[data-layout] body.has-hand #interpretationLeft {left:4px}
html[data-layout] body.has-hand #interpretationRight {right:4px}
html[data-layout] body.has-hand #interpretationOrbit .interpretation-card {padding:7px 8px;border-radius:10px}
}
/* A manually selected portrait presentation must not add flow content to the
   landscape scene's positioning rectangle; portrait viewports are untouched. */
@media (orientation:landscape) {
html[data-layout="portrait"] body.has-hand .story-stage-wrap .quest-hud,
html[data-layout="portrait"] body.has-hand .story-stage-wrap .story-caption {display:none}
}
