/* 1.1.0: keep controls readable at the same breakpoints as the navigation. */
.sidebar{overflow-y:auto;scrollbar-width:thin}
.page-context{min-width:0}.page-context b,.page-context span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.realm-overview>div,.system-grid>*,.cards-grid>*{min-width:0}.realm-overview h2,.subject-card h3,.owner-tag{overflow-wrap:anywhere}
.map-top{z-index:12;flex-wrap:wrap;gap:10px;align-items:flex-start}
.map-search{flex:1 1 160px;max-width:240px;width:auto}
#mapSearchResults{top:calc(100% + 8px);z-index:20;max-height:min(340px,50dvh);overflow-y:auto}
#mapSearchResults button{align-items:flex-start}#mapSearchResults button>span{min-width:0;overflow-wrap:anywhere;line-height:1.5}#mapSearchResults small{flex-shrink:0;line-height:1.5}
#mapSearchResults button:focus-visible{outline-offset:-3px;background:#294a40}
.atlas-controls{display:flex;flex-wrap:nowrap;gap:5px;padding:4px;border-radius:10px;margin-left:auto;width:auto}
.map-modes,.map-zoom{display:flex;align-items:center;gap:2px}.map-zoom{border-left:1px solid #70958a40;padding-left:5px}
.atlas-controls button{min-height:36px;border-radius:6px}.atlas-controls button.active{background:#355448;color:#fff2ce;box-shadow:inset 0 -2px #d7c48e}
.atlas-controls button:focus-visible{outline-offset:-2px}.atlas-controls button[id]{width:32px}
.province-panel{overscroll-behavior:contain;scrollbar-gutter:stable}
.province-panel .panel-heading{align-items:flex-start;gap:12px;position:sticky;top:0;z-index:2;background:#142c33;padding-bottom:10px}.panel-heading>div{min-width:0}.province-panel h2{overflow-wrap:anywhere;line-height:1.15}
.close-btn{flex-shrink:0;min-width:34px;min-height:34px;border-radius:8px}.province-panel .close-btn{position:sticky;top:0;background:#172f35}
.map-bottom{align-items:center;gap:10px;letter-spacing:0;padding:8px 0}.wall-status{overflow:hidden;text-overflow:ellipsis}
.map-screen:has(.province-panel:not([hidden])) .economic-legend{display:none}
dialog{padding:0;max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.dialog-head{position:sticky;top:0;z-index:2;margin:0 0 18px;padding:18px 22px;background:#183138;border-bottom:1px solid #587a724f}
.dialog-head h2{font-size:21px;line-height:1.3;overflow-wrap:anywhere}.dialog-head .close-btn{background:#11272e}
#dialogBody{padding:0 22px 22px}#dialogError{margin:0 22px 16px}
.update-notes h2{font-size:27px;line-height:1.2}.update-notes li{line-height:1.65}.update-notes .update-dismiss{align-items:flex-start;line-height:1.6}
@media(min-width:701px) and (max-width:900px){
  :root{--topbar:104px}
  .main-nav{position:static;display:flex;flex-direction:column;width:auto;height:auto;margin:0;padding:0;gap:4px;border:0;background:none;align-items:stretch;justify-content:flex-start}
  .main-nav button{flex:none;flex-direction:row;justify-content:flex-start;min-width:0;min-height:44px;height:auto;padding:12px 10px;margin:0;font-size:12px}
  .main-nav button.active{box-shadow:inset 3px 0 var(--ea-gold)}
  .header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:44px 32px;align-content:center;align-items:center;height:104px;padding:8px 16px;gap:0 12px}
  .page-context{grid-column:1;grid-row:1;margin:0}.game-calendar{grid-column:2;grid-row:1;padding:0}.game-calendar small{display:none}
  .header-actions{grid-column:3;grid-row:1;gap:6px}.settings-icon{display:grid}.account-btn{max-width:86px}
  .resources{grid-column:1/-1;grid-row:2;position:static;justify-content:flex-start;margin:0;height:32px;border-top:1px solid #55786e40;gap:22px}
  .resource{font-size:11px}.resource svg{width:14px}.map-screen{min-height:0;height:calc(100dvh - 104px)}
  .map-search{max-width:190px;flex-basis:170px}.map-top{top:14px}.atlas-controls button{padding:6px;font-size:10px}
  .province-panel{top:118px;bottom:42px}.found-hint{top:112px;max-width:calc(100% - 32px)}
}
@media(max-width:700px){
  .sidebar{overflow:visible}.main-nav{height:63px}.main-nav button{margin:0;min-width:0;min-height:63px;padding:6px 1px 4px;border-radius:0}
  .main-nav button>span{white-space:normal;line-height:1.2;text-align:center;min-height:20px;display:grid;place-items:center;font-size:9px}
  .main-nav button.active{box-shadow:inset 0 3px var(--ea-gold)}
  .header{padding-left:12px;padding-right:12px}.page-context{max-width:calc(100% - 152px)}.page-context b{font-size:13px}.header-actions{gap:5px}
  .map-screen{min-height:0}.map-top{top:12px;left:12px;right:12px;gap:8px}
  .map-search{width:100%;max-width:none;flex-basis:100%}
  .atlas-controls{width:100%;margin:0;padding:4px;display:block}.map-modes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}
  .atlas-controls .map-modes button{min-height:34px;font-size:10px;padding:6px 2px}
  .map-zoom{position:absolute;top:100px;right:0;display:flex;flex-direction:column;border:1px solid #76988b4f;border-radius:9px;background:#142b34ee;padding:4px;gap:3px;box-shadow:0 5px 20px #07161b55}
  .atlas-controls .map-zoom button{min-width:34px;min-height:34px;padding:0;font-size:20px}
  .map-screen:has(.province-panel:not([hidden])) .map-zoom{display:none}
  .province-panel{max-height:calc(100% - 152px);bottom:35px;padding:18px}
  .map-bottom{left:12px;right:12px;bottom:0;padding:9px 0;flex-wrap:nowrap;font-size:8px}.map-bottom .wall-status{max-width:calc(100% - 94px);font-size:8px;white-space:nowrap}.connection{flex-shrink:0}
  .economic-legend{bottom:48px;left:12px;width:min(265px,calc(100% - 70px));padding:12px}
  .nation-chip{max-width:calc(100% - 110px)}.nation-chip b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nation-chip>div{min-width:0}
  dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}.dialog-head{padding:16px 18px}#dialogBody{padding:0 18px 20px}#dialogError{margin-left:18px;margin-right:18px}
}
@media(max-width:700px) and (max-height:500px){
  :root{--topbar:94px}.header{height:94px;padding-top:8px}.header:has(.resources[hidden]){height:70px}
  .resources{height:24px}.game-calendar{bottom:24px;height:24px}.game-calendar small{display:none}
  .sidebar{height:calc(56px + env(safe-area-inset-bottom))}.main-nav{height:55px}.main-nav button{min-height:55px;padding:4px 1px}.main-nav svg{width:16px;height:16px}
  #app{padding-bottom:calc(56px + env(safe-area-inset-bottom))}.map-screen{height:calc(100dvh - 150px - env(safe-area-inset-bottom))}
  .header:has(.resources[hidden])~#app .map-screen{height:calc(100dvh - 126px - env(safe-area-inset-bottom))}
  .map-top{top:8px;gap:4px}.map-search input{min-height:32px;padding:6px 10px}.atlas-controls .map-modes button{min-height:28px}
  .map-zoom{top:82px;flex-direction:row}.map-bottom{padding:6px 0}.province-panel{max-height:calc(100% - 118px);bottom:28px;padding:12px}
  .nation-chip,.capital-shortcut{bottom:36px}
}
