/* MIERU AICHI v2.4.1-r2: hero full-width, bigger map, cleaner right panel */
:root{--ws-outline:#d6e4ed}
body:has(.workspace-nav) .intro--poster{display:block!important;padding:12px 0 10px}
body:has(.workspace-nav) .intro--poster .intro-art{max-width:1500px}
body:has(.workspace-nav) .intro--poster .intro-image{display:block!important;width:100%;aspect-ratio:auto;max-height:none;overflow:visible;border-radius:14px}
body:has(.workspace-nav) .intro--poster .intro-image img{display:block;width:100%;height:auto;max-width:100%;object-fit:contain;object-position:center}
body:has(.workspace-nav) .intro-bottom{padding-top:8px;padding-bottom:6px;gap:8px;flex-wrap:wrap}
body:has(.workspace-nav) .intro-bottom p{font-size:clamp(11px,1vw,14px)}
body:has(.workspace-nav) .atlas-wrap{padding-top:10px;padding-bottom:24px}
body:has(.workspace-nav) .atlas-heading{margin:0 0 10px;display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;flex-wrap:wrap}
body:has(.workspace-nav) .atlas-heading h2{font-size:clamp(1.1rem,1.5vw,1.5rem);margin:0}
body:has(.workspace-nav) .atlas-heading .eyebrow{display:none}
body:has(.workspace-nav) .city-picker{margin-bottom:10px;padding-block:8px}
body:has(.workspace-nav) .workspace{display:grid;grid-template-columns:minmax(0,2.05fr) minmax(340px,.95fr);gap:14px;align-items:stretch;width:100%;min-width:0}
body:has(.workspace-nav) .workspace,body:has(.workspace-nav) .workspace *{box-sizing:border-box}
body:has(.workspace-nav) .map-column{position:sticky;top:10px;align-self:start;min-width:0;width:100%;height:clamp(700px,calc(100dvh - 22px),1100px);min-height:0;overflow:hidden;padding:14px 16px;display:flex;flex-direction:column}
body:has(.workspace-nav) .map-column .map-heading{flex:0 0 auto}
body:has(.workspace-nav) .map-column .metric-picker{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:8px;margin-bottom:8px}
body:has(.workspace-nav) .metric-picker label,body:has(.workspace-nav) .metric-picker select{min-width:0;width:100%;max-width:100%}
body:has(.workspace-nav) .map-column .map-stage{flex:1 1 auto;min-height:520px;display:flex;align-items:stretch;overflow:hidden}
body:has(.workspace-nav) .map-column .map-view{height:100%;min-height:520px;width:100%;flex:1;overflow:hidden}
body:has(.workspace-nav) .map-column .map-view svg{width:100%;height:100%;min-height:0;max-height:none;display:block}
body:has(.workspace-nav) .map-column .map-source{font-size:10px;line-height:1.35;margin-top:6px}
body:has(.workspace-nav) .map-column .map-under{margin-top:6px;flex:0 0 auto}
body:has(.workspace-nav) .info-column{min-width:0;width:100%;height:clamp(700px,calc(100dvh - 22px),1100px);min-height:0;display:flex;flex-direction:column;overflow:hidden;gap:0;align-self:start;padding:0}
body:has(.workspace-nav) .info-column>.detail{flex:1 1 auto;min-height:0;min-width:0;width:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-bottom:14px}
body:has(.workspace-nav) .info-column>.detail[hidden],body:has(.workspace-nav) #tools[hidden]{display:none!important}
body:has(.workspace-nav) #tools{flex:1 1 auto;min-height:0;min-width:0;width:100%;max-width:100%;margin:0;padding:10px 4px 14px 0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain}
body:has(.workspace-nav) #tools .tool-content,body:has(.workspace-nav) #tools .tool-panel,body:has(.workspace-nav) #tools .panel{max-width:100%;min-width:0;width:100%}
body:has(.workspace-nav) .workspace-legacy-tabs{display:none!important}
.workspace-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:0 0 auto;gap:6px;padding:8px 6px 10px;margin:0;background:var(--surface,#fff);border-bottom:1px solid var(--ws-outline);position:relative;top:auto;z-index:3;min-width:0;overflow:visible}
.workspace-nav-button{font:inherit;cursor:pointer;min-width:0;white-space:normal;overflow-wrap:anywhere;min-height:38px;line-height:1.25;border:1px solid #cbd9e6;color:#344b63;background:#fff;border-radius:9px;padding:8px 6px;font-size:clamp(11px,.82vw,12px);font-weight:700;text-align:center}
.workspace-nav-button:hover,.workspace-nav-button:focus-visible{border-color:#2a80ad;outline-offset:1px}
.workspace-nav-button.is-current{background:#0d4976;border-color:#0d4976;color:#fff}
body:has(.workspace-nav) .info-column :is(input,select,textarea){max-width:100%;min-width:0}
body:has(.workspace-nav) .info-column :is(.metric-grid,.compare-selects,.report-controls,.report-grid,.discovery-controls,.extra-stats){min-width:0;max-width:100%}
body:has(.workspace-nav) .detail .metric-grid{grid-template-columns:1fr!important;gap:10px}
body:has(.workspace-nav) .detail .extra-stats{grid-template-columns:1fr!important;gap:10px}
body:has(.workspace-nav) .detail .number{font-size:clamp(2rem,2.3vw,2.4rem)}
body:has(.workspace-nav) .info-column :is(.metric-card,.comparison,.comparison-bars,.report-chart,.report-table,.discovery-chart,.insight-card,.extra-stat){min-width:0;max-width:100%}
body:has(.workspace-nav) .info-column :is(table,pre){max-width:100%}
body:has(.workspace-nav) .info-column table{display:block;overflow-x:auto}
body:has(.workspace-nav) .info-column :is(h1,h2,h3,h4,p,strong,span){overflow-wrap:anywhere}
body:has(.workspace-nav) .discovery-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body:has(.workspace-nav) .discovery-city-search-label{display:flex;flex-direction:column;gap:5px;margin:10px 0;font-size:.82rem;font-weight:700}
body:has(.workspace-nav) #discovery-city-search{width:100%;max-width:100%;min-height:40px;padding:8px;border:1px solid #bbcbd8;border-radius:9px;background:#fff}
body:has(.workspace-nav) .discovery-chart svg{width:100%;height:auto;max-height:340px}
.discovery-floating-label rect{fill:#163d62;stroke:#fff;stroke-width:1.4}
.discovery-floating-label text{fill:#fff;font-size:15px;font-weight:700}
.discovery-selected.is-hovered:after{content:attr(data-hover);display:block;border-top:1px solid #d5e0eb;margin-top:6px;padding-top:6px;font-size:.8rem}
body:has(.workspace-nav) #panel-report,body:has(.workspace-nav) #panel-discovery{min-width:0;max-width:100%;overflow-x:hidden}
@media(max-width:1280px) and (min-width:901px){
 body:has(.workspace-nav) .workspace{grid-template-columns:minmax(0,1.8fr) minmax(320px,.95fr);gap:12px}
}
@media(max-width:900px) and (min-width:781px){
 body:has(.workspace-nav) .workspace{grid-template-columns:minmax(0,1.55fr) minmax(280px,1fr);gap:10px}
 body:has(.workspace-nav) .map-column{padding:10px 12px;height:clamp(640px,calc(100dvh - 18px),980px)}
 body:has(.workspace-nav) .info-column{height:clamp(640px,calc(100dvh - 18px),980px)}
 .workspace-nav-button{font-size:10px;padding:7px 4px}
}
@media(max-width:780px){
 body:has(.workspace-nav) .intro--poster .intro-image{min-height:100px;max-height:none}
 body:has(.workspace-nav) .workspace{display:flex;flex-direction:column;gap:8px}
 body:has(.workspace-nav) .map-column{position:sticky;top:0;z-index:8;height:clamp(290px,48dvh,460px);min-height:0;max-height:none;padding:8px 10px;box-shadow:0 7px 20px rgba(10,52,86,.09)}
 body:has(.workspace-nav) .map-column .map-heading{display:none}
 body:has(.workspace-nav) .map-column .metric-meta,body:has(.workspace-nav) .map-column .map-source,body:has(.workspace-nav) .map-column .map-under{display:none}
 body:has(.workspace-nav) .map-column .metric-picker{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:4px 0}
 body:has(.workspace-nav) .map-column .metric-picker select{font-size:12px}
 body:has(.workspace-nav) .map-column .map-stage{flex:1;min-height:0}
 body:has(.workspace-nav) .info-column{height:auto;min-height:390px;max-height:none;overflow:visible}
 body:has(.workspace-nav) .info-column>.detail,body:has(.workspace-nav) #tools{max-height:none;overflow:visible}
 .workspace-nav{position:sticky;top:0;grid-template-columns:repeat(2,minmax(0,1fr));z-index:3}
 .workspace-nav-button{font-size:10px}
}
@media(max-width:420px){.workspace-nav{grid-template-columns:repeat(2,minmax(0,1fr))}.workspace-nav-button{font-size:9px;padding:7px 3px}}
/* r3: prevent the flex layout from compressing the statistic cards into each other.
   The detail panel is a scroll container, not a fixed-height card layout. */
body:has(.workspace-nav) .info-column > .detail{
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
  align-content:normal!important;
  min-height:0!important;
  height:auto!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
body:has(.workspace-nav) .info-column > .detail > *{
  flex-grow:0!important;
  flex-shrink:0!important;
  height:auto!important;
  max-height:none!important;
  min-height:0;
  position:static;
}
body:has(.workspace-nav) .info-column > .detail > .city-detail-content{
  flex:0 0 auto!important;
  min-height:0!important;
  height:auto!important;
  overflow:visible!important;
}
body:has(.workspace-nav) .info-column > .detail :is(.city-detail-pane,.extra-stats,.extra-stat,.metric-grid,.metric-card,.insight-card,.active-metric-card){
  position:static!important;
  max-height:none!important;
  height:auto!important;
  overflow:visible;
}
body:has(.workspace-nav) .info-column > .detail .detail-actions{margin-top:12px!important;flex:0 0 auto!important}
body:has(.workspace-nav) .info-column > .detail .city-detail-pane[hidden]{display:none!important}
body:has(.workspace-nav) .info-column > .detail .extra-stats{display:grid;grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:max-content;align-items:stretch}
body:has(.workspace-nav) .info-column > .detail .extra-stat{min-height:72px;display:flex;flex-direction:column;justify-content:center;gap:6px}
body:has(.workspace-nav) .info-column > .detail .active-metric-card{flex-shrink:0;display:block;margin-top:12px;margin-bottom:4px}

@media print{
 body:has(.workspace-nav) .intro--poster{display:block!important}
 .workspace-nav{display:none!important}
 body:has(.workspace-nav) .workspace{display:block!important}
 body:has(.workspace-nav) .map-column{position:static!important;height:auto!important;min-height:0!important}
 body:has(.workspace-nav) .info-column{height:auto!important;overflow:visible!important}
 body:has(.workspace-nav) .info-column>.detail,body:has(.workspace-nav) #tools{overflow:visible!important}
}
