/* R411 — One spacing / surface scale for Stadt-, Bürger- and Adminportal.
   Scoped by the Go-generated body data-section. Loaded LAST: feature-specific
   components, private World data and the existing navigation stay intact. */
body:is([data-section="public"],[data-section="citizen"],[data-section="admin"]){
  --nv-layout-edge:clamp(14px,1.65vw,36px);
  --nv-layout-gap:clamp(14px,1.13vw,22px);
  --nv-layout-panel-pad:clamp(15px,1.24vw,24px);
  --nv-layout-radius:14px;
  --nv-layout-outline:#80e6ff;
}
body:is([data-section="public"],[data-section="citizen"],[data-section="admin"])
  :is(a,button,input,textarea,select,[tabindex]):focus-visible{
  outline:2px solid var(--nv-layout-outline);
  outline-offset:3px;
}
body:is([data-section="public"],[data-section="citizen"],[data-section="admin"])
  :is(h1,h2,h3,h4,p,th,td,label,strong,small){overflow-wrap:break-word;}
body:is([data-section="public"],[data-section="citizen"],[data-section="admin"])
  :is(input,select,textarea){max-width:100%;min-width:0;}
/* Full-width image/media tables are retained in an internal horizontal
   scroller; do not silently clip critical World or finance columns. */
body:is([data-section="citizen"],[data-section="admin"])
  :is(.table-responsive,.admin-hypergrid-scroll){max-width:100%;overflow-x:auto;}

/* The public city site and its subsections share a common left/right edge.
   Keep the 3440px design wide without uncontrolled 82vw edge offsets. */
body[data-section="public"] .nv-home-container,
body[data-section="public"] .nv-home-header .nv-home-container{
  width:min(calc(100% - var(--nv-layout-edge) - var(--nv-layout-edge)),2240px);
  margin-inline:auto;
}
body[data-section="public"] .nv-public-page-stage{
  padding-top:clamp(54px,4.4vw,86px);
  padding-bottom:clamp(35px,4vw,78px);
}
body[data-section="public"] .nv-public-page :is(
  .nv-public-card,.nv-public-world-card,.nv-public-search-panel
){
  border-radius:var(--nv-layout-radius);
}
body[data-section="public"] .nv-public-page :is(
  .nv-public-map-content,.nv-public-world-content,.nv-public-discovery-content
){
  min-width:0;
}
/* Do not alter the source imagery, map transform, tile coordinates or scale. */

/* Both authenticated portals use the SAME canvas width and vertical rhythm;
   R334 previously styled only citizen pages, leaving admin pages with old
   16px padding and the legacy 1800px content cap. */
body:is([data-section="citizen"],[data-section="admin"]) .portal-main{
  min-width:0;
  background:
    radial-gradient(ellipse 70% 38% at 78% 0%,rgba(20,104,152,.15),transparent 73%),
    linear-gradient(180deg,#041a2a 0%,#03121f 48%,#020d18 100%);
}
body:is([data-section="citizen"],[data-section="admin"]) .portal-content{
  --nv-citizen-space:var(--nv-layout-gap);
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:var(--nv-layout-gap);
  width:min(calc(100% - var(--nv-layout-edge) - var(--nv-layout-edge)),1980px);
  max-width:none;
  min-width:0;
  margin-inline:auto!important;
  padding:var(--nv-layout-gap) 0 clamp(32px,3vw,54px)!important;
}
body:is([data-section="citizen"],[data-section="admin"]) .portal-content>*{
  min-width:0;
  max-width:100%;
}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content>:not(.row){margin-block:0!important;}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content>:is(.row){margin-block:0!important;}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content :is(.stats-grid,.dashboard-grid,.content-grid,.card-grid,
     .friends-layout,.map-layout,.admin-dashboard-layout){
  column-gap:var(--nv-layout-gap);
  row-gap:var(--nv-layout-gap);
  min-width:0;
}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content :is(.panel-card,.content-card,.stat-card){
  border-radius:var(--nv-layout-radius);
}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content .panel-card{padding:var(--nv-layout-panel-pad);}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content .panel-title{
  gap:12px;
  flex-wrap:wrap;
  min-width:0;
}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content .panel-title :is(h2,h3,h4){margin:0;line-height:1.35;}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-page-head{
  min-height:126px;
  display:flex;
  align-items:center;
  gap:clamp(12px,1.3vw,22px);
  padding:var(--nv-layout-panel-pad);
  border-radius:var(--nv-layout-radius);
  border:1px solid rgba(60,159,205,.43);
  margin:0!important;
}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-page-head>div:last-child{min-width:0;}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-page-head h1{
  font-size:clamp(23px,1.5vw,34px);
  line-height:1.2;
  letter-spacing:-.02em;
  margin:0 0 6px;
}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-page-head p{
  font-size:clamp(12px,.76vw,14px);
  line-height:1.5;
  margin:0;
  max-width:80ch;
}
body:is([data-section="citizen"],[data-section="admin"]) .portal-topbar{
  height:auto;
  min-height:72px;
  gap:clamp(10px,1vw,18px);
  padding:10px var(--nv-layout-edge);
}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-topbar .topbar-actions{gap:clamp(8px,.8vw,14px);min-width:0;}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-topbar .portal-search{min-width:0;max-width:640px;}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-footer-inner{padding-inline:var(--nv-layout-edge);}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content .stat-card{padding:clamp(14px,1vw,20px);}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content :is(.form-control,.form-select){min-height:40px;}
body:is([data-section="citizen"],[data-section="admin"])
  .portal-content :is(.btn,.form-control,.form-select){
  max-width:100%;
}
/* A constrained sidebar width is shared even on ultra-wide monitors. */
@media(min-width:992px){
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-sidebar.offcanvas-lg{width:270px;flex-basis:270px;}
}
@media(max-width:991.98px){
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-sidebar.offcanvas-lg{max-width:min(330px,92vw);}
}
@media(max-width:767.98px){
 body:is([data-section="public"],[data-section="citizen"],[data-section="admin"]){
   --nv-layout-edge:12px;
   --nv-layout-gap:14px;
   --nv-layout-panel-pad:15px;
 }
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-topbar{min-height:62px;padding:9px var(--nv-layout-edge);}
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-content{padding-top:14px!important;padding-bottom:28px!important;}
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-page-head{min-height:0;padding:16px;gap:12px;}
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-page-head h1{font-size:clamp(21px,5vw,27px);}
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-content :is(.panel-card,.stat-card){padding:14px;}
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-footer-inner{padding-inline:var(--nv-layout-edge);}
}
@media(max-width:430px){
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-page-head-icon{width:42px;height:42px;flex:0 0 42px;}
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-content .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
 body:is([data-section="citizen"],[data-section="admin"])
   .portal-topbar .topbar-user-copy{max-width:100px;overflow:hidden;}
}
@media(prefers-reduced-motion:reduce){
 body:is([data-section="public"],[data-section="citizen"],[data-section="admin"])
   :is(a,button,input,select,textarea){scroll-behavior:auto;transition-duration:.01ms!important;}
}

/* Historic admin sections still use .page-heading instead of
   .portal-page-head. Match the shared private header scale without
   duplicating titles or changing the existing semantic HTML. */
body[data-section="admin"] .portal-content>.page-heading{
  min-height:126px;
  padding:var(--nv-layout-panel-pad);
  border-radius:var(--nv-layout-radius);
  margin:0!important;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
}
body[data-section="admin"] .portal-content>.page-heading h1{
  margin:0;
  font-size:clamp(23px,1.5vw,34px);
  line-height:1.2;
  letter-spacing:-.02em;
}
body[data-section="admin"] .portal-content>.page-heading p{
  margin:0;
  font-size:clamp(12px,.76vw,14px);
  line-height:1.5;
  max-width:80ch;
}
@media(max-width:767.98px){
 body[data-section="admin"] .portal-content>.page-heading{
  min-height:0;
  padding:16px;
 }
 body[data-section="admin"] .portal-content>.page-heading h1{
  font-size:clamp(21px,5vw,27px);
 }
}

/* Standalone public content retains its editorial semantics while sharing
   the same gutter, focus and surface tokens. */
body.nv-article-page .nv-article-card{border-radius:var(--nv-layout-radius);}
body.nv-article-page .nv-article-top,
body.nv-article-page .nv-article-wrap{padding-inline:var(--nv-layout-edge);}
body.nv-service-page .nv-service-header,
body.nv-service-page .nv-service-main{
  max-width:1420px;
  padding-inline:var(--nv-layout-edge);
}
body.nv-firestorm .nv-fs-shell{min-width:0;}
body.nv-firestorm :is(.nv-fs-panel,.nv-fs-screen,.nv-fs-config){
  border-radius:var(--nv-layout-radius);
}
