html:root body .city-build-dialog .cbld-town.cbld-scenic-town[data-terrain][data-plot-count] .cbld-plot .cbld-building {
  left:0!important; bottom:0!important; width:100%!important; height:100%!important;
  object-fit:contain!important; object-position:center bottom!important; transform:scaleY(1.12)!important; transform-origin:center bottom;
  opacity:1; filter:brightness(var(--city-light,1)) saturate(var(--city-color,1)) contrast(.97)!important;
}

@media (min-width:701px) and (pointer:fine) {
  html:root body dialog#modal[open]:has(.birth-picker) {height:min(680px,calc(var(--game-logical-height,100dvh) - 40px))!important;box-sizing:border-box}
  html:root body dialog#modal #modal-content:has(.birth-picker) {display:flex!important;flex-direction:column;height:100%!important;min-height:0!important;overflow:hidden!important}
  html:root body #modal #modal-content:has(.birth-picker) .window-reading-body {flex:1;min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain}
  html:root body #modal .birth-picker .birth-option-grid {display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr))!important;gap:8px!important;height:auto!important;align-content:start}
  html:root body #modal .birth-picker .birth-option-grid .birth-option {display:grid!important;grid-template-columns:54px minmax(0,1fr)!important;align-items:center;align-content:center;gap:10px!important;padding:10px 14px!important;height:auto!important;min-height:78px!important}
  html:root body #modal .birth-picker .birth-option-grid .birth-option img {grid-area:auto;position:static;width:54px!important;height:62px!important;object-fit:cover}
  html:root body #modal .birth-picker .birth-option-body {display:grid;gap:2px;padding:0!important;line-height:1.25}
  html:root body #modal .birth-picker .birth-option-random>*:not(:first-child) {grid-column:2}
  html:root body dialog#modal .affairs-panel .affairs-grid {grid-template-columns:repeat(auto-fit,minmax(min(286px,100%),1fr))!important;gap:8px!important}
  html:root body dialog#modal .affairs-panel .affairs-grid>article[data-work-status] {min-height:0!important;height:auto!important;padding:10px 14px!important;gap:5px!important}
  html:root body dialog#modal .affairs-panel .affairs-task-heading>.affairs-task-art {width:100%;height:clamp(94px,9vh,128px)}
  html:root body dialog#modal .affairs-panel .affairs-task-heading>.affairs-task-art img {width:100%!important;height:100%!important;object-fit:cover}
  html:root body dialog#modal[open]:has(:is(.affairs-panel,.faction-detail-panel)) {width:min(1180px,calc(var(--game-logical-width,100vw) - 54px))!important}
  html:root body dialog#modal[open] .affairs-panel .affairs-grid {grid-template-columns:repeat(auto-fit,minmax(min(286px,100%),1fr))!important;column-gap:14px!important;row-gap:12px!important}
  html:root body dialog#modal .affairs-panel .affairs-task-heading {row-gap:7px!important}
  html:root body dialog#modal .faction-detail-grid {display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(246px,100%),1fr))!important;gap:6px!important}
  html:root body dialog#modal .faction-detail-grid article[data-faction-detail] {display:grid!important;grid-template-columns:35% minmax(0,1fr)!important;grid-template-rows:auto auto!important;align-content:center;gap:2px 10px!important;min-height:64px!important;height:auto!important;padding:8px 12px!important}
  html:root body dialog#modal .faction-detail-grid article[data-faction-detail]>img {grid-area:1/1/3/2!important;align-self:center;position:static!important;width:100%!important;height:70px!important;object-fit:cover}
  html:root body dialog#modal .faction-detail-grid article[data-faction-detail]>span {grid-area:1/2!important}
  html:root body dialog#modal .faction-detail-grid article[data-faction-detail]>strong {grid-area:2/2!important;line-height:1.15!important;font-size:20px!important}

  html:root body :is(#modal,.palace-stage) .result-reading .desktop-result-overview[data-active=true] {display:flex!important;flex-direction:column;align-items:stretch!important;justify-content:flex-start!important;overflow-y:auto!important;gap:6px!important}
  html:root body :is(#modal,.palace-stage) .result-reading .desktop-result-overview .desktop-result-cards {display:flex!important;flex-flow:row wrap!important;justify-content:center!important;align-content:flex-start!important;width:100%!important;max-width:none!important;gap:8px!important;flex:none!important}
  html:root body :is(#modal,.palace-stage) .result-reading .desktop-result-overview .desktop-result-cards :is(.growth-graph,.report-rewards>div.has-reward-gauge) {--result-card-width:clamp(150px,15vw,220px);align-self:flex-start!important;margin:0!important;box-sizing:border-box;flex:0 1 var(--result-card-width)!important;width:var(--result-card-width)!important;min-width:0!important;max-width:100%!important;aspect-ratio:220 / 146;height:auto!important;min-height:0!important;max-height:none!important;padding:10px 14px!important;gap:4px!important}
}
@media (min-width:701px) and (pointer:fine) {
  html:root body #modal .faction-detail-grid article[data-faction-detail]>i {grid-area:1/1/3/2!important;align-self:center;justify-self:center}
  html:root body #modal .faction-detail-grid article[data-faction-detail]:has(>img)>i {display:none!important}
}

/* Top-layer windows use a single desktop scale, including when opened above the map. */
html[data-game-scale] body dialog.action-scene[open] {
 inset:0 auto auto 0!important;transform:none!important;width:var(--game-logical-width)!important;height:var(--game-logical-height)!important;
}
@media(min-width:701px) and (pointer:fine) {
 html:root body .room-experience dialog.castle-city-sheet[data-city-sheet][open] {
  width:min(980px,calc(var(--game-logical-width,100vw) - 44px))!important;
  max-height:calc(var(--game-logical-height,100dvh) - 44px)!important;
  inset:0!important;margin:auto!important;height:fit-content!important;transform:none!important;
 }
 html:root body .castle-city-sheet .city-sheet-content {
  display:grid!important;grid-template-columns:minmax(0, .92fr) minmax(0,1fr);align-items:stretch;
 }
 html:root body .room-experience .castle-city-sheet .city-sheet-hero {
  min-height:240px;align-content:end;border:0;border-right:1px solid #87724f;
 }
 html:root body .castle-city-sheet .city-sheet-main {padding:20px 24px!important}
}

/* A nested dialog inherits the scale of its game canvas. */
html[data-game-scale] :is(.room-experience,.field-card-battle-overlay,.creation-card,.life-prologue) dialog {zoom:1}

@media (min-width:701px) and (pointer:fine) {
  html:root body :is(#modal,.palace-stage) .result-reading .desktop-result-cards > :is(.report-growth-graphs,.report-rewards) {display:contents!important}
}
