.affairs-panel{display:flex;flex-direction:column;gap:14px;min-width:0;color:#eee3cd;font-family:inherit}.affairs-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}.affairs-tabs button{padding:10px 4px;min-height:44px;white-space:nowrap}.affairs-tabs [aria-pressed=true]{background:#53432d;color:#fff0be}.affairs-meters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.affairs-meters span{display:grid;grid-template-columns:1fr auto;font-size:14px;gap:4px}.affairs-meters meter{grid-column:1/-1;width:100%;height:7px}.affairs-content{min-width:0;max-height:58dvh;overflow:auto;padding:4px 8px 12px;scrollbar-gutter:stable}.affairs-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}.affairs-grid article,.affairs-promise{padding:16px;background:rgba(42,35,26,.8);min-width:0}.affairs-panel h3,.affairs-panel h4{margin:0 0 8px;font-size:19px}.affairs-panel p{margin:8px 0;line-height:1.6;overflow-wrap:anywhere}.affairs-panel button{min-height:44px;max-width:100%;white-space:normal;font-family:inherit}.affairs-panel article button{width:100%;margin-top:8px}.affairs-panel progress{width:100%}.affairs-selectors{display:flex;gap:12px}.affairs-selectors label{flex:1;min-width:0}.affairs-selectors select{display:block;width:100%;min-height:44px;margin-top:6px;font:inherit}.affairs-news p{padding:12px 0;border-bottom:1px solid #695844}.palace-header .affairs-entry{min-width:44px;padding:4px 10px;font:inherit}@media(max-width:600px){.affairs-grid{grid-template-columns:1fr}.affairs-meters{gap:8px}.affairs-meters span{font-size:12px}.affairs-content{max-height:55dvh;padding:2px 4px 12px}.affairs-panel{gap:10px}.affairs-selectors{flex-direction:column}.affairs-tabs{gap:3px}.affairs-tabs button{font-size:12px}.palace-header .affairs-entry{padding:4px;min-width:36px}}
/* New management window uses the existing lacquer frame at a stable size. */
#modal:has(.affairs-panel){width:min(900px,calc(100vw - 24px))!important;height:min(760px,calc(100dvh - 24px))!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important}
#modal:has(.affairs-panel) #modal-content{height:100%;display:flex;flex-direction:column;min-height:0}
#modal:has(.affairs-panel) .modal-top{flex:none}
#modal .affairs-panel{flex:1;min-height:0;overflow:hidden}
#modal .affairs-content{flex:1;min-height:0;max-height:none}
.affairs-grid>p:only-child{grid-column:1/-1;font-size:14px;margin:0}
.affairs-panel article p{font-size:15px;line-height:1.45}
.affairs-panel article small{font-size:12px}
.affairs-panel .affairs-grid article{padding:12px}
.affairs-panel meter{appearance:none;background:#332e27;border:0;border-radius:0}
.affairs-panel meter::-webkit-meter-bar{background:#332e27;border:0;border-radius:0}
.affairs-panel meter::-webkit-meter-optimum-value{background:#b69d68}
@media(max-width:600px){#modal .affairs-panel{gap:8px}.affairs-panel article p{font-size:14px}.affairs-panel h3{font-size:17px}.affairs-grid{gap:8px;margin:8px 0}.affairs-selectors select{margin-top:3px}.affairs-meters span{font-size:11px}}
/* A recognisable management entry, without flashing or changing the game frame. */
html body .palace-header button.affairs-entry{display:inline-flex!important;align-items:center;justify-content:center;gap:7px;flex:none;min-width:112px;min-height:40px;padding:5px 13px!important;background:#593b32!important;color:#fff0cc!important;font-size:16px!important;font-weight:700;line-height:1;white-space:nowrap;box-shadow:inset 0 0 0 1px #b89a62!important}
.palace-header .affairs-entry-seal{font-size:23px;color:#ecd194;line-height:1}
.palace-header .affairs-entry-label{white-space:nowrap;line-height:1.1}
.palace-header .affairs-entry-count{display:grid;place-items:center;min-width:20px;height:20px;border-radius:50%;background:#eddbaf;color:#30231a;font-size:12px}
html body .palace-header button.affairs-entry:focus-visible{outline:2px solid #ffe4a0;outline-offset:3px}
@media(max-width:700px) and (orientation:portrait){html body .palace-header button.affairs-entry{min-width:62px;min-height:36px;gap:4px;padding:4px 7px!important;font-size:14px!important}.affairs-entry-desktop,.palace-header .affairs-entry-seal{display:none}.palace-header .affairs-entry-count{min-width:17px;height:17px;font-size:11px}}
@media(max-width:700px) and (orientation:portrait){
html body .palace-stage .palace-header{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto auto;grid-template-rows:1fr 1fr;gap:0 5px;padding:3px 7px!important;align-items:center}
html body .palace-stage .palace-header>strong{grid-column:1;grid-row:1;position:static!important;min-width:0;white-space:nowrap;font-size:13px!important;align-self:end;line-height:1.2}
html body .palace-stage .palace-header>strong small{font-size:10px!important}
html body .palace-stage .palace-header>span{grid-column:1;grid-row:2;position:static!important;transform:none!important;align-self:start;text-align:left;font-size:9px!important;line-height:1.4;white-space:nowrap}
html body .palace-stage .palace-header>.affairs-entry{grid-column:2;grid-row:1/3}
html body .palace-stage .palace-header>[data-palace-menu="menu"]{grid-column:3;grid-row:1/3}
html body .palace-stage .palace-header>[data-palace-menu="settings"]{grid-column:4;grid-row:1/3}
}
html body .palace-stage .palace-header button.affairs-entry{background-image:none!important;background-color:#684137!important;box-shadow:inset 0 0 0 1px #c6a773,inset 0 -3px 0 #c6a773!important;color:#fff1d0!important}
html body .affairs-hud{position:absolute!important;display:flex!important;align-items:center;justify-content:space-between;gap:12px;height:44px;min-height:44px;box-sizing:border-box;margin:0!important;padding:5px 12px!important;background:#3d3029!important;color:#f5e5c6!important;border:1px solid #a88d61!important;font-family:inherit;z-index:3;cursor:pointer}
.affairs-hud-title{display:flex;align-items:center;gap:7px;white-space:nowrap;color:#e7c78c;font-size:18px}.affairs-hud-title strong{font-size:15px}.affairs-hud-title small{font-size:11px}
.affairs-hud-values{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.affairs-hud-values>span{display:flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap}.affairs-hud-values b{font-size:16px;color:#fff0d3}
@media(max-width:700px){
html body .mobile-hud-layout.mobile-hud-layout.has-affairs-hud{--hud-h:202px;grid-template-rows:44px 212px 32px minmax(0,1fr) 42px 54px!important}
html body .mobile-hud-layout.mobile-hud-layout.has-affairs-hud.is-room-result{grid-template-rows:44px 212px 0 minmax(0,1fr) 0 54px!important}
html body .mobile-hud-layout.mobile-hud-layout.has-affairs-hud.is-lobby .room-lobby{inset:258px 0 54px!important}
html body .mobile-hud-layout .affairs-hud{padding:4px 7px!important;gap:6px}.affairs-hud-title{gap:3px;font-size:14px}.affairs-hud-title strong{font-size:12px}.affairs-hud-title small{display:none}.affairs-hud-values{gap:8px}.affairs-hud-values>span{display:grid;gap:1px;text-align:center;font-size:10px}.affairs-hud-values b{font-size:13px}
html body .palace-stage.has-affairs-hud .palace-header{grid-template-columns:minmax(0,1fr) auto auto!important}
html body .palace-stage.has-affairs-hud .palace-header>[data-palace-menu="menu"]{grid-column:2!important}
html body .palace-stage.has-affairs-hud .palace-header>[data-palace-menu="settings"]{grid-column:3!important}
}
.affairs-hud-values{grid-template-columns:repeat(5,1fr);gap:14px}
@media(max-width:700px){.affairs-hud-values{gap:7px}}

/* Management uses the existing lacquer asset and reserves space above facility navigation. */
html body .palace-stage .affairs-hud{background:transparent!important;border:4px solid transparent!important;border-image:url('assets/ui-window-lacquer-1029.webp') 180 fill / 12px / 0 stretch!important;box-shadow:none!important;border-radius:0;padding-inline:12px!important}
@media(min-width:701px){
 html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms{position:absolute!important;top:var(--affairs-nav-top,280px)!important;bottom:80px!important;left:12px!important;height:auto!important;margin:0!important;padding:0!important;justify-content:center;gap:8px}
 html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms>button{flex:1 1 0!important;height:auto!important;min-height:0!important;max-height:92px!important;padding-block:8px!important}
}

html body .affairs-hud-values,html body .affairs-hud-values>span,html body .affairs-hud-values b{line-height:1.15!important}
/* Leave breathing room between the location plaque and its action/category cards. */
html body .room-experience:not(.is-lobby):not(.is-room-result) .palace-desk{padding-top:14px!important}
@media(max-width:700px){
 html body .mobile-hud-layout:not(.is-lobby):not(.is-room-result) .palace-desk{padding-top:10px!important}
 html body .mobile-hud-layout:not(.is-lobby):not(.is-room-result) .room-location{height:32px!important;align-items:center!important}
 html body .mobile-hud-layout:not(.is-lobby):not(.is-room-result) .room-location .room-name{margin-block:0!important}
}
/* Subcategory tabs share raster lacquer/bronze materials with the game windows. */
html body #modal .affairs-panel .affairs-tabs{gap:6px;flex:none;padding:3px 1px}
html body #modal .affairs-panel .affairs-tabs>button{
 display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;height:48px;min-height:48px;
 padding:8px 5px!important;border:3px solid transparent!important;border-radius:0!important;
 border-image:url('assets/ui-window-lacquer-1029.webp') 180 fill / 7px / 0 stretch!important;
 background:transparent!important;box-shadow:none!important;color:#d4cbbc!important;font-size:15px;font-weight:600;line-height:1.2;white-space:nowrap!important;
}
html body #modal .affairs-panel .affairs-tabs>button[aria-pressed=true]{
 border-image-source:url('assets/ui-window-bronze-charcoal-1029.webp')!important;color:#ffe3a0!important;font-weight:800;
}
html body #modal .affairs-panel .affairs-tabs>button::before,html body #modal .affairs-panel .affairs-tabs>button::after{content:none!important}
html body #modal .affairs-panel .affairs-tabs>button:focus-visible{outline:2px solid #ecd49b!important;outline-offset:1px}
@media(max-width:600px){html body #modal .affairs-panel .affairs-tabs{gap:3px}html body #modal .affairs-panel .affairs-tabs>button{height:44px;min-height:44px;padding:5px 2px!important;font-size:12px;border-image-width:5px!important}}
/* Desktop facility signs retain their height on both action and result screens. */
@media(min-width:701px){
 html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms{
  display:flex!important;flex-direction:column!important;grid-area:auto!important;align-self:auto!important;justify-self:auto!important;
  width:208px!important;top:var(--affairs-nav-top,280px)!important;bottom:80px!important;height:auto!important;
  justify-content:center!important;align-items:stretch!important;gap:8px!important;
 }
 html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms>button{
  flex:0 1 76px!important;width:208px!important;height:76px!important;min-height:56px!important;max-height:76px!important;
  margin:0!important;padding:12px 20px!important;box-sizing:border-box!important;
 }
 html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms>button strong{font-size:18px!important;line-height:1.3!important}
 html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms>button small{font-size:11px!important;line-height:1.4!important}
}
@media(min-width:701px){
 html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms>button{min-width:208px!important;max-width:208px!important;position:relative!important;inset:auto!important;transform:none!important}
 html body .city-experience.has-affairs-hud[data-facility=map] .palace-desk{padding:40px 72px 7px 0!important;box-sizing:border-box!important}
}
.affairs-alert{box-sizing:border-box;width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px;border:6px solid transparent;border-image:url('assets/ui-window-lacquer-1029.webp') 180 fill / 14px / 0 stretch;background:transparent;color:#f3e5c8;font-family:var(--serif);overflow:auto}
.affairs-alert::backdrop{background:#0009;backdrop-filter:blur(3px)}
.affairs-alert>img{display:block;width:100%;height:clamp(130px,28dvh,250px);object-fit:cover}
.affairs-alert-copy{padding:18px 16px 12px}.affairs-alert-copy small{color:#cdb787}.affairs-alert h2{font:700 24px/1.35 var(--serif);margin:9px 0 12px}.affairs-alert p{font:16px/1.65 var(--serif);margin:0;word-break:keep-all;overflow-wrap:anywhere}
.affairs-alert footer{display:flex;justify-content:flex-end;gap:10px;padding:8px 16px 12px}.affairs-alert button{min-height:44px;padding:8px 12px;font:600 15px/1.3 var(--serif);color:#f4deb2;background:transparent;border:3px solid transparent;border-image:url('assets/ui-window-bronze-charcoal-1029.webp') 180 fill / 6px}
@media(max-width:600px){.affairs-alert-copy{padding:12px 10px}.affairs-alert h2{font-size:21px}.affairs-alert footer{padding:5px 10px 10px;gap:8px}.affairs-alert button{flex:1;font-size:14px}}
@media(min-width:701px) and (max-height:760px){html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms{gap:4px!important}html body .city-experience.has-affairs-hud:not(.is-lobby) .palace-rooms>button{min-height:52px!important;padding-block:8px!important}}
/* Keep facility plaques spacious instead of compressing them to fit the rail. */
@media(min-width:701px){
 html body .city-experience.city-experience:not(.is-lobby) .palace-rooms{
  overflow-y:auto!important;overflow-x:hidden!important;justify-content:safe center!important;
  gap:10px!important;padding:4px 0!important;scrollbar-width:thin;
 }
 html body .city-experience.city-experience:not(.is-lobby) .palace-rooms>button{
  flex:0 0 92px!important;height:92px!important;min-height:92px!important;max-height:92px!important;
  padding:18px 24px!important;box-sizing:border-box!important;
 }
 html body .city-experience.city-experience:not(.is-lobby) .palace-rooms>button>span{gap:5px!important;justify-content:center!important}
 html body .city-experience.city-experience:not(.is-lobby) .palace-rooms>button strong{line-height:1.35!important}
 html body .city-experience.city-experience:not(.is-lobby) .palace-rooms>button small{line-height:1.4!important}
}
@media(min-width:701px) and (max-height:800px){
 html body .city-experience.city-experience:not(.is-lobby) .palace-rooms>button{flex-basis:76px!important;height:76px!important;min-height:76px!important;max-height:76px!important;padding:12px 24px!important}
}

/* Keep meter labels whole; reserve the scrollable body rather than shrinking type. */
@media(max-width:600px){#modal .affairs-meters{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px;flex:none}#modal .affairs-meters span{font-size:12px;white-space:nowrap}#modal .affairs-content{overscroll-behavior:contain;scrollbar-width:thin;padding-inline:8px;padding-bottom:24px}#modal .affairs-panel>p{font-size:12px;line-height:1.4;margin:0;flex:none}}
