/* User-facing shell only. Module content and the standalone login remain untouched. */
#appPage {
  --shell-rail: 228px;
  --shell-gutter: 32px;
  --shell-content: 1120px;
  --shell-rail-bg: #fbfafc;
  min-height: 100dvh;
}
#productSidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 35;
  width: var(--shell-rail);
  padding: 24px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--shell-rail-bg);
  border-right: 1px solid var(--line);
}
#productSidebar .sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; min-height: 40px; }
#productSidebar .brand { gap: 11px; font-size: 23px; font-weight: 750; letter-spacing: -.025em; color: var(--text); }
#productSidebar .brand-mark { width: 36px; height: 36px; }
#productSidebar .main-nav { display: flex; flex-direction: column; align-items: stretch; gap: 7px; height: auto; margin-top: 40px; }
#productSidebar .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  min-height: 48px;
  height: auto;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
#productSidebar .nav-link svg, .shell-icon-button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#productSidebar .nav-link:hover { background: #f0eef4; color: var(--text); }
#productSidebar .nav-link.active { color: var(--purple); background: #f2edfc; font-weight: 650; }
#productSidebar .nav-link.active::before { content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; width: 2px; border-radius: 2px; background: var(--purple); }
#productSidebar .nav-link:focus-visible, #appPage .shell-icon-button:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
#productWorkspace { min-width: 0; margin-left: var(--shell-rail); }
#productWorkspace .container { width: min(var(--shell-content), calc(100% - var(--shell-gutter) * 2)); margin-inline: auto; }
#productWorkspace > .topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  height: 72px;
  min-height: 72px;
  padding: 0 var(--shell-gutter);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: nowrap;
  background: #ffffffed;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  box-shadow: none;
}
#productWorkspace > .topbar > :is(.guest-actions, .user-area) { margin-left: auto; }
#productWorkspace .product-view > section:first-child { padding-top: 28px; padding-bottom: 26px; }
#productWorkspace > .guest-banner { padding-inline: var(--shell-gutter); }
#productWorkspace > footer .container { min-height: 64px; }
#appPage .mobile-shell-brand, #sidebarClose, #sidebarBackdrop { display: none; }
#appPage .shell-icon-button { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
#appPage .shell-icon-button:hover { color: var(--purple); background: var(--ui-accent-soft); }
#appPage #sidebarClose { display: none; }
@media (min-width: 1600px) { #appPage { --shell-gutter: 48px; } }
@media (min-width: 1024px) and (max-width: 1150px) { #appPage { --shell-rail: 210px; --shell-gutter: 24px; } }
@media (max-width: 1023px) {
  #appPage { --shell-gutter: 28px; }
  #productWorkspace { margin-left: 0; }
  #productWorkspace > .topbar { justify-content: space-between; height: 68px; min-height: 68px; gap: 12px; }
  #appPage .mobile-shell-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
  #appPage .mobile-shell-brand .brand { font-size: 20px; gap: 8px; }
  #appPage .mobile-shell-brand .brand-mark { width: 30px; height: 30px; }
  #productSidebar { width: min(280px, calc(100% - 48px)); z-index: 45; padding-top: 20px; visibility: hidden; transform: translateX(-100%); transition: transform .2s ease, visibility .2s ease; }
  #productSidebar .sidebar-heading { padding-right: 0; }
  #appPage #sidebarClose { display: inline-grid; }
  #productSidebar .main-nav { margin-top: 28px; }
  #appPage #sidebarBackdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 40; background: #24243259; }
  body.navigation-open { overflow: hidden; }
  body.navigation-open #productSidebar { visibility: visible; transform: translateX(0); }
}
@media (max-width: 760px) {
  #appPage { --shell-gutter: 16px; }
  #productWorkspace > .topbar { height: 64px; min-height: 64px; gap: 8px; }
  #appPage .mobile-shell-brand { gap: 6px; }
  #appPage .mobile-shell-brand .brand { font-size: 18px; gap: 7px; }
  #productWorkspace > .topbar .user-area { gap: 8px; }
  #productWorkspace > .topbar .user-chip { display: flex; }
  #productWorkspace > .topbar .user-chip > div { display: none; }
  #productWorkspace > .topbar .guest-actions { gap: 6px; }
  #productWorkspace > .topbar .guest-actions button { padding-inline: 10px; }
  #productWorkspace .product-view > section:first-child { padding-top: 24px; padding-bottom: 22px; }
}
@media (max-width: 360px) {
  #appPage { --shell-gutter: 12px; }
  #appPage .mobile-shell-brand .brand-mark { width: 28px; height: 28px; }
  #appPage .mobile-shell-brand .brand { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  #productSidebar, #productSidebar .nav-link { transition: none; }
}
