/* The screen owns the frame; only explicit content regions scroll. */
html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body > .shell,
body > .wk-shell,
body > .staff-shell,
body .wk-main {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  margin-top: 0;
  margin-bottom: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-block: 24px;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
}
body > .shell,
body > .staff-shell { position: relative; }
body > .wk-app {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
body [hidden] { display: none !important; }
body .wk-main { width: 100%; }
body.shop-page { padding-bottom: 0; }
body.admin-page > .shell { padding: 0; }
body.admin-page #adminPanel { min-height: 0; }
body.admin-page.admin-locked > .shell {
  display: block;
  min-height: 0;
  padding-block: max(24px, env(safe-area-inset-top, 0px));
}
body.auth-page .auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
body.auth-page .wk-auth-card { flex: 0 0 auto; margin-block: auto; }
body > .staff-bottom-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body :is(.input, .select, .textarea, input, select, textarea) {
  font-size: max(16px, 1em);
  scroll-margin-block: 24px;
}
body :is(.dialog-card, .lg-card) {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
body > .lg-backdrop.wallet-dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
body > .wallet-dialog .lg-card {
  width: min(540px, 100%);
  min-height: 0;
  margin: 0;
  box-sizing: border-box;
  border-radius: 24px;
  scroll-padding-block: 16px;
}

/* One viewport dock and one matching scroll clearance across all workspaces. */
:root {
  --bottom-nav-height: 3.75rem;
  --bottom-nav-space: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
}
body:has(.shop-nav:not([hidden]), .wk-bottom-nav:not([hidden])) > :is(.shell, .wk-shell, .staff-shell),
body:has(.wk-bottom-nav:not([hidden])) .wk-main {
  padding-bottom: calc(var(--bottom-nav-space) + 24px);
  scroll-padding-bottom: calc(var(--bottom-nav-space) + 24px);
}
/* Fixed descendants must keep the viewport as their containing block. */
body:has(.shop-nav, .wk-bottom-nav),
body > .wk-app {
  transform: none;
  filter: none;
  perspective: none;
  contain: none;
  will-change: auto;
}
body :is(.shop-nav.shop-nav, .wk-bottom-nav.wk-bottom-nav) {
  position: fixed;
  inset: auto 0 0;
  z-index: 60;
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--bottom-nav-space);
  flex-direction: row;
  flex-wrap: nowrap;
  min-height: var(--bottom-nav-space);
  margin: 0;
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  transform: none;
  pointer-events: auto;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, .8);
  border-radius: 14px 14px 0 0;
  background: linear-gradient(120deg, rgba(255,255,255,.62), rgba(225,237,255,.38) 46%, rgba(255,255,255,.58));
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  backdrop-filter: blur(22px) saturate(175%);
  box-shadow: 0 -8px 32px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(148,163,184,.22);
}
body :is(.shop-nav, .wk-bottom-nav)[hidden] { display: none !important; }
body [data-nav-workspace] { display: none !important; }
body[data-nav-role="shop"] .shop-nav[data-nav-workspace="shop"]:not([hidden]),
body[data-auth-workspace="boss"][data-workspace-ready="boss"] [data-nav-workspace="boss"]:not([hidden]),
body[data-auth-workspace="merchant"][data-workspace-ready="merchant"] [data-nav-workspace="merchant"]:not([hidden]),
body[data-auth-workspace="staff"][data-workspace-ready="staff"] [data-nav-workspace="staff"]:not([hidden]) { display: flex !important; }
body.auth-page [data-nav-workspace] { display: none !important; }
body :is(.shop-nav.shop-nav, .wk-bottom-nav.wk-bottom-nav)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(ellipse at 18% 0, rgba(255,255,255,.65), transparent 48%), linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent) top / 85% 1px no-repeat;
}
body .shop-nav-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body :is(.shop-nav-item, .wk-bottom-item) {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  min-height: 44px;
  padding: 4px;
  gap: 2px;
  color: #334155;
  font-size: .6875rem;
  line-height: 1.2;
  text-decoration: none;
}
body :is(.shop-nav-label, .wk-bottom-item > span:last-child) { font-size: inherit; line-height: 1.2; }
body :is(.shop-nav-icon, .wk-bottom-ico) svg { width: 20px; height: 20px; }
body :is(.shop-nav-item, .wk-bottom-item).is-active {
  color: #123e79;
  font-weight: 700;
  background: linear-gradient(145deg, rgba(239,246,255,.85), rgba(147,197,253,.45));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 0 0 1px rgba(59,130,246,.22);
}
body :is(.shop-nav-item, .wk-bottom-item):focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: -3px;
}
body :is(.shop-nav-item, .wk-bottom-item):active { background-color: rgba(147,197,253,.5); }
body .shop-nav-cart .shop-nav-icon {
  width: 34px;
  height: 26px;
  margin: 0;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
body .shop-nav-cart .cart-badge { top: 0; right: calc(50% - 30px); }
body .shop-nav-item.shop-nav-cart { padding-bottom: 4px; gap: 4px; }
@supports not (backdrop-filter: blur(1px)) {
  @supports not (-webkit-backdrop-filter: blur(1px)) {
    body :is(.shop-nav.shop-nav, .wk-bottom-nav.wk-bottom-nav) { background: #eaf0f8; }
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (update: slow) {
  body :is(.shop-nav.shop-nav, .wk-bottom-nav.wk-bottom-nav) {
    background: #eaf0f8;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body :is(.shop-nav.shop-nav, .wk-bottom-nav.wk-bottom-nav)::before { display: none; }
}
@media (forced-colors: active) {
  body :is(.shop-nav.shop-nav, .wk-bottom-nav.wk-bottom-nav) { background: Canvas; border: 1px solid CanvasText; }
  body :is(.shop-nav-item, .wk-bottom-item).is-active { outline: 2px solid Highlight; outline-offset: -3px; }
}
