/*
 * VIX Hosting R22.57.173 — Design Quality + Responsive Workspace Layer
 * Final, scoped visual-quality contract for public, auth, admin and account surfaces.
 * Purpose: typography legibility, radius discipline, overflow safety, responsive controls,
 * component consistency and accessible focus without rewriting capability-specific CSS.
 */
:root{
  --dq-radius-xs:6px;
  --dq-radius-sm:8px;
  --dq-radius-md:10px;
  --dq-radius-lg:12px;
  --dq-radius-xl:14px;
  --dq-radius-pill:999px;
  --dq-text-xs:12px;
  --dq-text-sm:13px;
  --dq-text-md:14px;
  --dq-text-base:15px;
  --dq-text-lg:17px;
  --dq-control-h:42px;
  --dq-control-h-touch:44px;
  --dq-leading:1.5;
  --dq-leading-tight:1.25;
}

/* Universal resilience: content may grow, translate or contain long IDs/URLs. */
:where(.px-admin-body,.px-auth,.site-page) :where(*, *::before, *::after){box-sizing:border-box}
:where(.px-admin-body,.px-auth,.site-page) :where(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,legend,small,strong,span,a,button,th,td){min-width:0}
:where(.px-admin-body,.px-auth,.site-page) :where(p,li,dt,dd,label,legend,small,th,td,.muted,.help,.hint,.description,.description-text){overflow-wrap:anywhere}
:where(.px-admin-body,.px-auth,.site-page) :where(img,svg,video,canvas){max-width:100%}

/* Authenticated shell typography: keep density, remove 9–11 px body copy. */
.px-admin-body{font-size:var(--dq-text-base);line-height:var(--dq-leading)}
.px-admin-body .px-content{font-size:var(--dq-text-md);line-height:var(--dq-leading);letter-spacing:0}
.px-admin-body .px-content :where(p,li,dd,dt,label,legend,input,select,textarea,button){font-size:max(var(--dq-text-sm),1em)}
.px-admin-body .px-content :where(small,.px-help,.help,.hint,.form-help,.field-help,.meta,.metadata,.muted,.subtle){font-size:var(--dq-text-xs);line-height:1.45}
.px-admin-body .px-content :where(h1){font-size:clamp(24px,2.1vw,32px);line-height:1.15;letter-spacing:-.025em}
.px-admin-body .px-content :where(h2){font-size:clamp(19px,1.55vw,24px);line-height:1.2;letter-spacing:-.018em}
.px-admin-body .px-content :where(h3){font-size:clamp(16px,1.25vw,19px);line-height:1.25}
.px-admin-body .px-content :where(h4,h5,h6){font-size:var(--dq-text-base);line-height:1.3}

/* Navigation remains compact but readable. */
.px-admin-body :where(.px-nav-home,.px-nav-section-toggle){font-size:13px}
.px-admin-body .px-nav-subitem{font-size:12.5px;min-height:34px}
.px-admin-body :where(.px-version-card span,.px-version-card small,.px-version-card a,.px-nav-no-results small){font-size:11.5px;line-height:1.35}
.px-admin-body .px-nav-count{font-size:11px;min-width:21px;height:21px}

/* Radius discipline: semantic surfaces use only 10/12/14; pills remain pills. */
.px-admin-body .px-content :where(.px-card,.portal-card,.billing-panel,.panel,.card,.surface,.settings-card,.module-card,.summary-card,.detail-card,.metric-card,.stat-card,.notice-card,.table-card,.form-card,.section-card){border-radius:var(--dq-radius-lg)}
.px-admin-body .px-content :where(fieldset,.form-section,.filter-bar,.toolbar,.data-panel,.empty-state,.callout,.notice,.alert){border-radius:var(--dq-radius-md)}
.px-admin-body .px-content :where(.badge,.pill,.status-pill,.px-badge,[class*="status-"][class*="badge"]){border-radius:var(--dq-radius-pill)}

/* Common cards: eliminate floating nested-box look and inconsistent borders. */
.px-admin-body .px-content :where(.px-card,.portal-card,.billing-panel,.settings-card,.module-card,.summary-card,.detail-card,.metric-card,.stat-card,.table-card,.form-card){
  border-color:var(--ui-border);
  box-shadow:none;
}
.px-admin-body .px-content :where(.px-card,.portal-card,.billing-panel,.settings-card,.module-card,.summary-card,.detail-card,.table-card,.form-card) :where(.px-card,.portal-card,.panel,.card){box-shadow:none}

/* Controls share one physical rhythm and never collapse to tiny typography. */
.px-admin-body .px-content :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){
  min-height:var(--dq-control-h);
  max-width:100%;
  border-radius:var(--dq-radius-sm);
  font-size:var(--dq-text-sm);
  line-height:1.35;
}
.px-admin-body .px-content textarea{min-height:104px;resize:vertical}
.px-admin-body .px-content :where(button,.btn,.button,.px-btn,[class*="-button"],[class*="btn-"]){
  min-height:40px;
  max-width:100%;
  border-radius:var(--dq-radius-sm);
  font-size:var(--dq-text-sm);
  line-height:1.2;
  white-space:normal;
  overflow-wrap:anywhere;
}
.px-admin-body .px-content :where(input,select,textarea,button,.btn,.button,.px-btn,a):focus-visible{
  outline:3px solid var(--ui-focus);
  outline-offset:2px;
}

/* Labels and field stacks get enough breathing room. */
.px-admin-body .px-content :where(label,.field-label,.form-label){font-weight:650;line-height:1.35}
.px-admin-body .px-content :where(.field,.form-field,.form-group,.input-group){min-width:0}
.px-admin-body .px-content :where(.field,.form-field,.form-group)>:where(label,.field-label,.form-label){margin-bottom:6px}

/* Tables: readable without forcing desktop widths into mobile viewport. */
.px-admin-body .px-content :where(.table-wrap,.table-responsive,.data-table-wrap,.px-table-wrap){max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch}
.px-admin-body .px-content table{max-width:100%;font-size:var(--dq-text-sm);line-height:1.4}
.px-admin-body .px-content :where(th,td){padding-top:10px;padding-bottom:10px;vertical-align:middle}
.px-admin-body .px-content th{font-size:12px;letter-spacing:.01em}
.px-admin-body .px-content td :where(.badge,.pill,.status-pill,.px-badge){font-size:11.5px;line-height:1.2}

/* Long technical values should scroll locally instead of exploding a grid/card. */
.px-admin-body .px-content :where(code,pre,.mono,.code,.token,.hash,.url,.technical-value){max-width:100%}
.px-admin-body .px-content :where(code,.mono,.code,.token,.hash,.url,.technical-value){overflow-wrap:anywhere;word-break:break-word}
.px-admin-body .px-content pre{overflow:auto;white-space:pre-wrap}

/* Grid/flex children must be shrinkable; recurring source of broken layouts. */
.px-admin-body .px-content :where([class*="grid"],[class*="row"],[class*="columns"],[class*="split"],[class*="layout"]){min-width:0}
.px-admin-body .px-content :where([class*="grid"],[class*="row"],[class*="columns"],[class*="split"],[class*="layout"])>*{min-width:0}

/* Auth surfaces: readable labels, consistent cards and controls. */
.px-auth{font-size:var(--dq-text-base);line-height:var(--dq-leading)}
.px-auth .px-auth-card{border-radius:var(--dq-radius-xl)}
.px-auth :where(label,input,select,textarea,button,.px-btn){font-size:var(--dq-text-sm)}
.px-auth :where(input:not([type="checkbox"]):not([type="radio"]),select,button,.px-btn){min-height:44px;border-radius:var(--dq-radius-sm)}
.px-auth :where(p,small,.help,.hint,.muted){font-size:var(--dq-text-xs);line-height:1.45}
.px-auth :where(h1,h2){overflow-wrap:anywhere}

/* Public website: preserve brand scale while protecting minimum body readability. */
.site-page{font-size:16px;line-height:1.6}
.site-page main :where(p,li,dd,dt,label,input,select,textarea,button){font-size:max(14px,1em)}
.site-page main :where(small,.eyebrow,.kicker,.meta,.hint,.help,.microcopy){font-size:12px;line-height:1.45}
.site-page main :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){min-height:44px;border-radius:var(--dq-radius-sm)}
.site-page main :where(button,.btn,.button,[class*="btn-"]){min-height:42px;border-radius:var(--dq-radius-sm);white-space:normal;overflow-wrap:anywhere}
.site-page main :where(.card,.panel,.pricing-card,.feature-card,.content-card,.form-card){border-radius:var(--dq-radius-lg)}
.site-page main :where(h1){overflow-wrap:anywhere;line-height:1.08}
.site-page main :where(h2,h3,h4){overflow-wrap:anywhere;line-height:1.2}

/* Narrow screens: controls become comfortable and multi-column content collapses safely. */
@media (max-width:760px){
  .px-admin-body .px-content{font-size:14px}
  .px-admin-body .px-content :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,button,.btn,.button,.px-btn,[class*="-button"],[class*="btn-"]){min-height:var(--dq-control-h-touch)}
  .px-admin-body .px-content :where(.actions,.button-row,.form-actions,.toolbar-actions,.card-actions){flex-wrap:wrap}
  .px-admin-body .px-content :where(.actions,.button-row,.form-actions,.toolbar-actions,.card-actions)>*{max-width:100%}
  .px-admin-body .px-content :where(.two-col,.two-columns,.three-col,.three-columns,.four-col,.four-columns){grid-template-columns:minmax(0,1fr)}
  .site-page main :where(button,.btn,.button,[class*="btn-"]){min-height:44px}
}

/* Very narrow widths: prevent horizontal page overflow caused by fixed child widths. */
@media (max-width:480px){
  .px-admin-body .px-content :where(.px-card,.portal-card,.billing-panel,.panel,.card,section,article,form,fieldset){max-width:100%}
  .px-admin-body .px-content :where(input,select,textarea,button,.btn,.button,.px-btn){width:auto;min-width:0}
  .px-admin-body .px-content :where(.form-actions,.button-row,.card-actions)>:where(button,.btn,.button,.px-btn,a){width:100%}
  .site-page main :where(.actions,.button-row,.form-actions){flex-wrap:wrap}
}

@media (prefers-reduced-motion:reduce){
  :where(.px-admin-body,.px-auth,.site-page) *,
  :where(.px-admin-body,.px-auth,.site-page) *::before,
  :where(.px-admin-body,.px-auth,.site-page) *::after{scroll-behavior:auto;animation-duration:.01ms;animation-iteration-count:1;transition-duration:.01ms}
}

/* Common metadata/status typography kept compact, never microscopic. */
.px-admin-body .px-content :where(.px-badge,.badge,.pill,.status-pill,[class*="badge"],[class*="pill"]){font-size:11.5px;line-height:1.25}
.px-admin-body :where(.px-topbar-context,.px-admin-return-shortcut,.px-site-link,.px-theme-toggle,.px-message-shortcut,.px-top-warning){font-size:12px}
.px-admin-body :where(.px-user-summary strong,.px-user-popover-head strong,.px-user-mini strong){font-size:12px}
.px-admin-body :where(.px-user-summary small,.px-user-popover-head span,.px-user-mini small,.px-server-clock small,.px-server-clock span){font-size:11.5px}

/* Catch recurring surface suffixes while staying inside application content. */
.px-admin-body .px-content :where([class$="-card"],[class$="-panel"],[class$="-surface"]){border-radius:var(--dq-radius-lg)}
.px-admin-body .px-content :where([class$="-toolbar"],[class$="-filter"],[class$="-filters"],[class$="-group"]){border-radius:var(--dq-radius-md)}

/* Public microcopy/statuses: 12 px floor without inflating decorative icon-only controls. */
.site-page main :where([class*="badge"],[class*="pill"],[class*="status"],[class*="meta"],[class*="eyebrow"],[class*="kicker"]){font-size:max(12px,1em)}

/* ==========================================================================
   VIX Hosting R22.57.173 — Responsive Workspace Contract
   Use the available workspace without turning readable text/forms into full-width lines.
   ========================================================================== */
:root{
  --dq-workspace-max:none;
  --dq-gutter:clamp(14px,1.55vw,34px);
  --dq-card-gap:clamp(12px,1vw,18px);
}

/* Admin and customer portals are workspaces, not narrow marketing pages. */
.px-admin-body:is(.px-area-admin,.px-area-account) .px-content{
  width:100%;
  max-width:none;
  margin-inline:0;
  padding-inline:var(--dq-gutter);
}

/* Let data-dense surfaces consume the width while keeping prose comfortably readable. */
.px-admin-body .px-content :where(.px-section-head>div:first-child,.px-card-head>div:first-child,.ux-dashboard-head>div:first-child){min-width:0}
.px-admin-body .px-content :where(.px-section-head p,.px-card-head p,.help-copy,.prose,.readable-copy){max-width:78ch}
.px-admin-body .px-content :where(.px-table-wrap,.table-wrap,.table-responsive,.data-table-wrap,.vix-user-directory,.billing-panel,.portal-card,.px-card){width:100%}

/* General grids scale with the actual content area instead of leaving dead columns. */
.px-admin-body .px-content .px-grid{gap:var(--dq-card-gap)}
@media (min-width:1500px){
  .px-admin-body .px-content .px-grid.cols-4{grid-template-columns:repeat(4,minmax(220px,1fr))}
  .px-admin-body .px-content .px-grid.cols-3{grid-template-columns:repeat(3,minmax(260px,1fr))}
  .px-admin-body .px-content .px-grid.cols-2{grid-template-columns:repeat(2,minmax(320px,1fr))}
  .px-admin-body.px-area-admin .vix-user-search{grid-template-columns:minmax(300px,2.2fr) minmax(170px,.8fr) minmax(190px,.9fr) auto}
  .px-admin-body.px-area-admin .vix-user-directory .px-table{min-width:1100px}
}
@media (min-width:1900px){
  .px-admin-body .px-content .px-grid.cols-4{grid-template-columns:repeat(4,minmax(260px,1fr))}
  .px-admin-body .px-content .px-grid.cols-3{grid-template-columns:repeat(3,minmax(320px,1fr))}
  .px-admin-body.px-area-account .ux-dashboard-columns{grid-template-columns:minmax(0,1.38fr) minmax(360px,.72fr)}
  .px-admin-body.px-area-account .ux-account-secondary{grid-template-columns:minmax(0,1.2fr) minmax(380px,.8fr)}
}

/* Intermediate widths: avoid the abrupt desktop -> single-column jump. */
@media (max-width:1380px){
  .px-admin-body .px-content .px-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .px-admin-body .px-content .px-grid.cols-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1040px){
  .px-admin-body .px-content{padding-inline:clamp(14px,2.2vw,22px)}
  .px-admin-body .px-content .px-grid.cols-3{grid-template-columns:1fr}
}
@media (max-width:760px){
  .px-admin-body:is(.px-area-admin,.px-area-account) .px-content{padding-inline:12px}
  .px-admin-body .px-content :where(.px-grid.cols-4,.px-grid.cols-3,.px-grid.cols-2){grid-template-columns:1fr}
  .px-admin-body .px-content :where(.px-card-head,.px-section-head){gap:10px}
  .px-admin-body .px-content :where(.px-card-head,.px-section-head)>.px-actions{width:100%;justify-content:flex-start}
  .px-admin-body .px-content :where(.px-card-head,.px-section-head)>.px-actions>*{max-width:100%}
}

/* Data tables use horizontal space first, then scroll locally on small screens. */
.px-admin-body .px-content :where(.px-table-wrap,.table-wrap,.table-responsive,.data-table-wrap){
  scrollbar-gutter:stable both-edges;
  contain:inline-size;
}
.px-admin-body .px-content :where(.px-table,.billing-table,[class$="-table"]){width:100%}

/* Wide workspaces should not stretch simple forms into unreadable lines. */
.px-admin-body .px-content :where(.px-form,.form-card form,.settings-card form):not(.wide-form):not([data-wide-form]){max-width:100%}
.px-admin-body .px-content :where(.px-field>input,.px-field>select,.px-field>textarea){min-width:0}



/* Remove legacy per-module desktop caps inside authenticated workspaces. These were
   responsible for the visible empty gutters even after the shell became fluid. */
.px-admin-body .px-content :where(
  .v57-dashboard,
  .order-detail-v3,
  .vix-notice-center,
  .provisioning-v3,
  .appt-workspace,
  .appt-workspace-user,
  .vix-admin
){width:100%;max-width:none;margin-inline:0}

/* Service/account/detail workspaces should grow with the viewport. Document-like
   artifacts (invoice sheets, legal copy) intentionally keep their reading width. */
.px-admin-body .px-content :where(.service-detail,.portal-dashboard,.account-dashboard,.customer-service-workspace){width:100%;max-width:none}

/* Wide monitors: use the extra room for useful information, not decorative whitespace. */
@media (min-width:1680px){
  .px-admin-body .px-content{padding-inline:clamp(20px,1.35vw,32px)}
  .px-admin-body .px-content .px-grid.cols-4{grid-template-columns:repeat(4,minmax(250px,1fr))}
  .px-admin-body .px-content .px-grid.cols-3{grid-template-columns:repeat(3,minmax(300px,1fr))}
  .px-admin-body .px-content .px-grid.cols-2{grid-template-columns:repeat(2,minmax(360px,1fr))}
  .px-admin-body.px-area-account .v57-dashboard{max-width:none}
  .px-admin-body.px-area-account .v57-grid--analytics{grid-template-columns:minmax(0,1.7fr) minmax(360px,.65fr)}
  .px-admin-body.px-area-account .v57-grid--main{grid-template-columns:minmax(0,1.22fr) minmax(380px,.78fr)}
}

/* Laptop/tablet transitions: retain useful two-column layouts until space truly runs out. */
@media (min-width:761px) and (max-width:1180px){
  .px-admin-body .px-content :where(.v57-grid--analytics,.v57-grid--main,.ux-dashboard-columns,.ux-account-secondary){grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .px-admin-body .px-content :where(.v57-grid--analytics,.v57-grid--main,.ux-dashboard-columns,.ux-account-secondary){grid-template-columns:minmax(0,1fr)}
  .px-admin-body .px-content :where(.vix-user-search,.filter-grid,.search-grid){grid-template-columns:minmax(0,1fr)}
}

/* Long action rows and filter bars must wrap instead of forcing page-level overflow. */
.px-admin-body .px-content :where(.px-actions,.actions,.toolbar-actions,.filter-actions,.card-actions,.billing-panel-actions){flex-wrap:wrap;min-width:0}
.px-admin-body .px-content :where(.px-actions,.actions,.toolbar-actions,.filter-actions,.card-actions,.billing-panel-actions)>*{min-width:0;max-width:100%}

/* Keep compact metadata readable after capability CSS loaded earlier in the cascade. */
.px-admin-body .px-content :where(.px-badge,.badge,.pill,.status-pill,[class*="badge"],[class*="pill"]){font-size:max(12px,1em)}
.px-admin-body .px-content :where(.v57-kicker,[class$="-kicker"],[class*="__kicker"]){font-size:max(12px,1em)}
