/* Textile Engine 2.12.0-candidate.5 — Shell ownership closure. */
:root{
  --pt-shell-sidebar-width:264px;
  --pt-shell-header-height:76px;
  --pt-shell-context-height:40px;
  --pt-shell-content-max:1800px;
  --pt-shell-page-inline:28px;
  --pt-shell-env-offset:0px;
  --pt-shell-backup-height:0px;
}

/* The application shell is now a real DOM structure. Legacy fixed-position geometry is explicitly retired. */
body.pt-shell-v280{margin:0!important;padding:0!important;min-height:100dvh;background:var(--pt-canvas,#f4f6f3)}
body.pt-shell-v280 #pt-app-shell-v279{
  display:grid;
  grid-template-columns:var(--pt-shell-sidebar-width) minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr);
  min-height:100dvh;
  width:100%;
  min-width:0;
}
body.pt-shell-v280 #pt-environment-slot-v279{
  grid-column:1/-1;
  grid-row:1;
  position:sticky;
  top:0;
  z-index:60;
  min-width:0;
}
body.pt-shell-v280 #test-env-banner{
  position:relative!important;
  inset:auto!important;
  top:auto!important;right:auto!important;left:auto!important;
  width:100%!important;
  min-height:0;
  box-shadow:none;
}
body.pt-shell-v280 #pt-sidebar-v279{
  grid-column:1;
  grid-row:2;
  position:sticky!important;
  top:var(--pt-shell-env-offset)!important;
  right:auto!important;left:auto!important;bottom:auto!important;
  width:var(--pt-shell-sidebar-width)!important;
  max-width:none!important;
  height:calc(100dvh - var(--pt-shell-env-offset))!important;
  min-height:0;
  align-self:start;
  transform:none;
  visibility:visible;
  z-index:30!important;
}
body.pt-shell-v280 #pt-workspace-v279{
  grid-column:2;
  grid-row:2;
  min-width:0;
  width:100%;
  background:var(--pt-canvas,#f4f6f3);
}
body.pt-shell-v280 #pt-app-header-v279{
  position:sticky!important;
  top:var(--pt-shell-env-offset)!important;
  right:auto!important;left:auto!important;
  width:100%!important;
  height:var(--pt-shell-header-height)!important;
  min-height:var(--pt-shell-header-height)!important;
  display:grid!important;
  grid-template-columns:auto minmax(150px,1fr) minmax(220px,760px) auto;
  grid-template-areas:"menu identity panel session";
  align-items:center;
  gap:12px;
  margin:0!important;
  padding:0 26px!important;
  z-index:25!important;
}
body.pt-shell-v280 #menu{grid-area:menu}
body.pt-shell-v280 #pt-page-identity-v279{grid-area:identity;display:flex!important;flex-direction:column!important;gap:2px!important;min-width:0}
body.pt-shell-v280 #pt-header-panel-v279{grid-area:panel;display:flex!important;align-items:center;min-width:0;min-height:0;overflow:hidden}
body.pt-shell-v280 #pt-header-panel-v279 #market-board-v252{margin:0!important;max-width:none!important;width:100%;min-width:0!important;flex:1 1 auto!important}
body.pt-shell-v280 #pt-header-panel-v279 #market-board-v252 .mb-row-v252{min-width:max-content!important}
body.pt-shell-v280 .pt-session-area-v279{grid-area:session;margin:0!important;justify-self:end;min-width:0}

body.pt-shell-v280 #breadcrumb-bar{
  position:sticky!important;
  top:calc(var(--pt-shell-env-offset) + var(--pt-shell-header-height))!important;
  right:auto!important;left:auto!important;
  width:100%!important;
  height:var(--pt-shell-context-height)!important;
  min-height:var(--pt-shell-context-height)!important;
  max-height:var(--pt-shell-context-height)!important;
  display:flex!important;
  align-items:center;
  overflow-x:auto;
  overflow-y:hidden;
  z-index:24!important;
}
body.pt-shell-v280 #pt-system-alert-slot-v279{
  position:relative;
  z-index:3;
  width:100%;
  min-width:0;
  display:grid;
}
body.pt-shell-v280 #pt-system-alert-slot-v279:empty{display:none}
body.pt-shell-v280 #backup-health-banner,
body.pt-shell-v280 #backup-health-banner.v2148{
  position:relative!important;
  top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;
  width:100%!important;
  min-height:0!important;
  margin:0!important;
  z-index:auto!important;
  border-radius:0!important;
  box-shadow:none!important;
}
body.pt-shell-v280 #pt-system-alert-slot-v279 #network-status-banner{
  position:relative!important;
  inset:auto!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  border-inline:0!important;
}
body.pt-shell-v280 #pt-system-alert-slot-v279 #network-status-banner[hidden],
body.pt-shell-v280 #backup-health-banner[hidden]{display:none!important}

body.pt-shell-v280 #pt-page-viewport-v279,
body.pt-shell-v280 main#app{
  position:relative!important;
  inset:auto!important;
  margin:0 auto!important;
  width:100%!important;
  max-width:var(--pt-shell-content-max)!important;
  min-width:0!important;
  padding:18px var(--pt-shell-page-inline) 44px!important;
  overflow-x:clip;
}

/* PageLayout compatibility boundary. New visual primitives are opt-in; legacy renderers keep their own internals. */
body.pt-shell-v280 main#app.pt-page-mode-legacy-v279{--pt-page-layout-mode:legacy}
body.pt-shell-v280 main#app.pt-page-mode-v2-v279{--pt-page-layout-mode:v2}
body.pt-shell-v280 main#app.pt-page-mode-legacy-v279>[data-pt-page-layout="legacy"]{
  min-width:0;
  max-width:100%;
  margin-top:0!important;
}
body.pt-shell-v280 main#app.pt-page-mode-v2-v279>[data-pt-page-layout="v2"]{
  min-width:0;
  max-width:100%;
  margin-top:0!important;
}
/* Do not let v278 page primitives leak into a non-migrated page even if a historical class name collides. */
body.pt-shell-v280 main#app.pt-page-mode-legacy-v279>.pt-page-v278:not(.settings-page-v2160){
  display:block;
  gap:initial;
}

/* Wide viewport always uses the structural grid, even if an old compact-touch class survived. */
@media(min-width:821px){
  body.pt-shell-v280.compact-touch-v243 #pt-app-shell-v279{grid-template-columns:var(--pt-shell-sidebar-width) minmax(0,1fr)!important}
  body.pt-shell-v280.compact-touch-v243 #pt-sidebar-v279{position:sticky!important;width:var(--pt-shell-sidebar-width)!important;max-width:none!important;transform:none!important;visibility:visible!important}
  body.pt-shell-v280.compact-touch-v243 #pt-workspace-v279{grid-column:2!important}
  body.pt-shell-v280.compact-touch-v243 main#app{margin:0 auto!important;width:100%!important;max-width:var(--pt-shell-content-max)!important;padding-inline:var(--pt-shell-page-inline)!important}
  body.pt-shell-v280.compact-touch-v243 #pt-app-header-v279,
  body.pt-shell-v280.compact-touch-v243 #breadcrumb-bar{right:auto!important}
}

@media(max-width:980px){
  body.pt-shell-v280 #pt-app-header-v279{grid-template-columns:auto minmax(140px,1fr) minmax(160px,42vw) auto;padding-inline:16px!important;gap:8px}
  body.pt-shell-v280 .pt-session-area-v279 #session-user{display:none}
}

@media(max-width:820px){
  :root{--pt-shell-sidebar-width:min(82vw,300px);--pt-shell-page-inline:12px;--pt-shell-context-height:36px}
  body.pt-shell-v280 #pt-app-shell-v279{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
  body.pt-shell-v280 #pt-workspace-v279{grid-column:1;grid-row:2}
  body.pt-shell-v280 #pt-sidebar-v279{
    position:fixed!important;
    top:var(--pt-shell-env-offset)!important;
    right:0!important;
    left:auto!important;
    width:var(--pt-shell-sidebar-width)!important;
    max-width:calc(100vw - 44px)!important;
    height:calc(100dvh - var(--pt-shell-env-offset))!important;
    transform:translateX(105%)!important;
    visibility:hidden!important;
    transition:transform .2s ease,visibility .2s!important;
    z-index:40!important;
  }
  body.pt-shell-v280.menu #pt-sidebar-v279{transform:none!important;visibility:visible!important}
  body.pt-shell-v280 #pt-app-header-v279{
    grid-template-columns:38px minmax(95px,1fr) minmax(105px,38vw) auto;
    padding-inline:10px!important;
    gap:7px;
  }
  body.pt-shell-v280 #menu{display:grid!important}
  body.pt-shell-v280 #pt-page-identity-v279 strong{font-size:14px}
  body.pt-shell-v280 #pt-page-identity-v279 small{font-size:8px}
  body.pt-shell-v280 .pt-session-area-v279 #clock{display:none}
  body.pt-shell-v280 .pt-session-area-v279 #logout{padding-inline:7px!important;min-width:0}
  body.pt-shell-v280 #breadcrumb-bar{padding-inline:10px!important}
  body.pt-shell-v280 main#app{padding:12px var(--pt-shell-page-inline) 30px!important;max-width:100%!important}
}

@media(max-width:520px){
  body.pt-shell-v280 #pt-app-header-v279{grid-template-columns:36px minmax(92px,1fr) minmax(95px,36vw) auto;gap:5px}
  body.pt-shell-v280 #pt-header-panel-v279 #market-board-v252{overflow:hidden!important;border:0!important;background:transparent!important;padding:0!important}
  body.pt-shell-v280 #pt-app-header-v279 #logout{font-size:0;width:32px;height:32px;padding:0!important}
  body.pt-shell-v280 #pt-app-header-v279 #logout::after{content:'↩';font-size:15px}
}
/* Settings is the only v2 page in C4. Its sticky rail must follow the new shell, not legacy backup offsets. */
body.pt-shell-v280 main#app.pt-page-mode-v2-v279 .settings-tabs-v235.pt-settings-nav-v278{
  top:calc(var(--pt-shell-env-offset, 0px) + var(--pt-shell-header-height, 72px) + var(--pt-shell-context-height, 38px) + 18px)!important;
}



/* C5: shell geometry has one owner. Historical state classes are content/state only. */
body.pt-shell-v280.test-env-active,
body.pt-shell-v280.backup-warning-active{padding-top:0!important}

/* Readability follow-up: slightly larger sidebar typography without changing shell geometry. */
body.pt-shell-v280.pt-ui-v278 .nav-group-toggle-v2160 b{font-size:13px}
body.pt-shell-v280.pt-ui-v278 .nav-group-v2160.open>.nav-group-items-v2160>button,
body.pt-shell-v280.pt-ui-v278 .nav-standalone-v2160{font-size:12px}
