/*
 * PE-Class application shell foundation v11646
 *
 * One authoritative desktop contract for the common header, left navigation,
 * and main content frame. Existing iPad, Fold and compact-device refinements
 * intentionally remain responsible for their own breakpoints during the
 * staged migration.
 */

html[data-pe-shell="11646"],
html[data-pe-shell="11646"] body {
  height: 100%;
}

html[data-pe-shell="11646"] .pe87Top {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pe-f-header-gap);
  height: var(--pe-f-header-height);
  padding: 0 var(--pe-f-header-padding-inline);
  border-bottom: 1px solid #cfd9e5;
  background: var(--pe-f-color-surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

html[data-pe-shell="11646"] .pe87Brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
}

html[data-pe-shell="11646"] .pe87Logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--pe-f-logo-size);
  height: var(--pe-f-logo-size);
  border: 3px solid #2fa3ef;
  border-radius: 50%;
  background: #2f4358;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.20);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
}

html[data-pe-shell="11646"] .pe87Logo > span {
  margin-top: 1px;
  font-size: 9px;
}

html[data-pe-shell="11646"] .pe87Title strong {
  display: block;
  color: #26364a;
  font-size: 18px;
  line-height: 1.25;
}

html[data-pe-shell="11646"] .pe87Title b {
  display: block;
  color: #2b96e5;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

html[data-pe-shell="11646"] .pe87UserTools {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

html[data-pe-shell="11646"] .pe87User {
  margin-right: 4px;
  color: #3b2a60;
  font-size: 13px;
  font-weight: 900;
}

html[data-pe-shell="11646"] .miniBtn {
  padding: 8px 12px;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

html[data-pe-shell="11646"] .miniBtn.orange { background: #f28b20; }
html[data-pe-shell="11646"] .miniBtn.gray { background: #7f8c8d; }
html[data-pe-shell="11646"] .miniBtn.red { background: #e84c3d; }

html[data-pe-shell="11646"] .pe87Shell {
  display: grid;
  min-height: calc(100vh - var(--pe-f-header-height));
  background: var(--pe-f-shell-canvas);
}

html[data-pe-shell="11646"] .pe87Side {
  box-sizing: border-box;
  background: var(--pe-f-color-surface);
  border-right: 1px solid var(--pe-f-shell-line);
  box-shadow: 2px 0 8px rgba(15, 23, 42, 0.04);
  overflow: auto;
}

html[data-pe-shell="11646"] .brandBox {
  display: none;
}

html[data-pe-shell="11646"] .pe87Main {
  min-width: 0;
}

html[data-pe-shell="11646"] #app {
  min-height: calc(100vh - 112px);
  padding: var(--pe-f-app-padding);
  border: 1px solid #d6e0eb;
  border-radius: 6px;
  background: var(--pe-f-color-surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

html[data-pe-shell="11646"] .sideTabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

html[data-pe-shell="11646"] .sideTabs .tab {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #d9e1ea;
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
  color: #26364a;
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

@media (min-width: 921px) {
  html[data-pe-shell="11646"]:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide) .pe87Top {
    position: fixed;
    z-index: 5000;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
  }

  html[data-pe-shell="11646"]:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide) .pe87Logo {
    flex: 0 0 var(--pe-f-logo-size);
  }

  html[data-pe-shell="11646"]:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide) .pe87Shell {
    display: grid;
    grid-template-columns: var(--pe-f-side-width) minmax(0, 1fr);
    margin-top: var(--pe-f-header-height);
  }

  html[data-pe-shell="11646"]:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide) .pe87Side {
    position: sticky;
    z-index: 50;
    top: var(--pe-f-header-height);
    width: var(--pe-f-side-width);
    height: calc(100vh - var(--pe-f-header-height));
    padding: var(--pe-f-side-padding);
  }

  html[data-pe-shell="11646"]:not(.pe87Ipad):not(.pe87IpadRuntime):not(.pe87FoldWide) .pe87Main {
    padding: var(--pe-f-main-padding);
  }
}

/*
 * v11647 — iPad 11-inch landscape shell regression guard
 *
 * The legacy iPad sheet changes every viewport at or below 1100px into a
 * horizontal menu. A full-screen 11-inch iPad can enter that range in Safari,
 * so keep the established desktop-like left rail for landscape only.
 * Portrait iPad, compact phones and Fold wide layouts remain untouched.
 */
@media (min-width: 900px) and (max-width: 1100px) and (orientation: landscape) {
  html[data-pe-shell="11646"].pe87Ipad:not(.pe87FoldWide) .pe87Shell,
  html[data-pe-shell="11646"].pe87IpadRuntime:not(.pe87FoldWide) .pe87Shell {
    display: grid !important;
    grid-template-columns: 225px minmax(0, 1fr) !important;
    min-height: calc(100dvh - 76px) !important;
  }

  html[data-pe-shell="11646"].pe87Ipad:not(.pe87FoldWide) .pe87Side,
  html[data-pe-shell="11646"].pe87IpadRuntime:not(.pe87FoldWide) .pe87Side {
    position: sticky !important;
    top: 76px !important;
    width: auto !important;
    height: calc(100dvh - 76px) !important;
    padding: 13px 11px !important;
    border-right: 1px solid #d9e1ea !important;
    border-bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  html[data-pe-shell="11646"].pe87Ipad:not(.pe87FoldWide) .sideTabs,
  html[data-pe-shell="11646"].pe87IpadRuntime:not(.pe87FoldWide) .sideTabs {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  html[data-pe-shell="11646"].pe87Ipad:not(.pe87FoldWide) .sideTabs .tab,
  html[data-pe-shell="11646"].pe87IpadRuntime:not(.pe87FoldWide) .sideTabs .tab {
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    white-space: normal !important;
  }

  html[data-pe-shell="11646"].pe87Ipad:not(.pe87FoldWide) .sideTree,
  html[data-pe-shell="11646"].pe87IpadRuntime:not(.pe87FoldWide) .sideTree {
    display: block !important;
  }

  html[data-pe-shell="11646"].pe87Ipad:not(.pe87FoldWide) .pe87Main,
  html[data-pe-shell="11646"].pe87IpadRuntime:not(.pe87FoldWide) .pe87Main {
    min-width: 0 !important;
    padding: 12px !important;
  }
}
