/* V1 workspace shell, ported without V1 data hooks or API dependencies. */
.workspace {
  position: relative;
  isolation: isolate;
  grid-template-columns: 72px minmax(0, 1fr);
  overflow-x: clip;
  background: transparent;
}

body.react-navigation-ready .workspace { grid-template-columns: 60px minmax(0, 1fr); }
body.react-navigation-ready .workspace-sidebar { visibility: hidden; }
#react-navigation { position: relative; z-index: 20; }

.app-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 4%, rgba(177, 225, 219, .72), transparent 31%),
    radial-gradient(circle at 8% 86%, rgba(220, 213, 244, .68), transparent 34%),
    linear-gradient(145deg, #eef8f7, #f4f3fb 52%, #f9eeeb);
}

.app-backdrop i {
  position: absolute;
  width: 36vw;
  height: 36vw;
  border-radius: 50%;
  opacity: .45;
  filter: blur(90px);
  animation: vista-orb-drift 28s ease-in-out infinite alternate;
}

.app-backdrop i:nth-child(1) { top: -14vw; right: -8vw; background: #9bded5; }
.app-backdrop i:nth-child(2) { bottom: -17vw; left: -9vw; background: #cfc6ec; animation-delay: -9s; }
.app-backdrop i:nth-child(3) { top: 35%; right: 22%; width: 24vw; height: 24vw; background: #f1cfc8; animation-delay: -17s; }

@keyframes vista-orb-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-28px, 24px, 0) scale(1.08); }
}

.workspace-sidebar,
.content,
.mobile-nav-toggle,
.mobile-nav-scrim {
  position: relative;
  z-index: 1;
}

.workspace-sidebar {
  display: block;
  position: sticky;
  top: 0;
  width: 72px;
  height: 100vh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.sidebar-panel {
  display: flex;
  width: 48px;
  height: calc(100vh - 32px);
  margin: 16px 12px;
  padding: 7px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius:20px;
  background: rgba(255, 255, 255, .46);
  box-shadow: 0 10px 30px rgba(30, 61, 72, .1), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(24px) saturate(150%);
  transition: width .26s ease, box-shadow .26s ease, background .26s ease;
}

.sidebar-panel:hover,
.sidebar-panel:focus-within {
  width: 192px;
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 18px 44px rgba(30, 61, 72, .14), inset 0 1px 0 rgba(255, 255, 255, .95);
}

.workspace-sidebar .brand {
  min-height: 34px;
  gap: 10px;
  white-space: nowrap;
}

.workspace-sidebar .brand strong,
.workspace-sidebar .nav-label,
.sidebar-workspace {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .18s ease, transform .22s ease;
}

.sidebar-panel:hover .brand strong,
.sidebar-panel:hover .nav-label,
.sidebar-panel:hover .sidebar-workspace,
.sidebar-panel:focus-within .brand strong,
.sidebar-panel:focus-within .nav-label,
.sidebar-panel:focus-within .sidebar-workspace {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-workspace {
  margin: 20px 7px 3px;
  overflow: hidden;
  color: #70858d;
  font-size:13px;
  font-weight:600;
  letter-spacing:.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.workspace-sidebar nav {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}

.workspace-sidebar nav button,
.workspace-sidebar .quiet {
  display: flex;
  min-width: 176px;
  min-height: 38px;
  margin: 0;
  padding: 4px;
  align-items: center;
  gap: 10px;
  border-radius:14px;
  white-space: nowrap;
}

.workspace-sidebar nav button:hover,
.workspace-sidebar .quiet:hover {
  color: #205e6e;
  background: rgba(255, 255, 255, .5);
}

.workspace-sidebar nav .nav-active {
  color: #17696f;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 7px 20px rgba(39, 82, 91, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.nav-icon {
  display: grid;
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius:8px;
}

.nav-icon svg,
.mobile-nav-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  display: grid;
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border-radius:999px;
  color: white;
  background: #237b84;
  font-size:11px;
  font-weight:700;
}

.workspace-sidebar .quiet {
  margin-top: auto;
  color: #6b8088;
  background: transparent;
  text-align: left;
}

.content {
  min-width: 0;
  padding: 28px 34px 38px 26px;
}

.content > header {
  min-height: 70px;
  align-items: center;
}

.page-heading h1 {
  font-size: clamp(27px, 3vw, 34px);
  letter-spacing:-.018em;
}

.view-subtitle {
  display: flex;
  margin: 8px 0 0;
  align-items: center;
  gap: 7px;
  color: #60747c;
  font-size:13px;
}

.view-subtitle i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2b9a8f;
  box-shadow: 0 0 0 4px rgba(43, 154, 143, .12);
}

.inbox-grid,
.pipeline-view,
.test-composer {
  backdrop-filter: blur(24px) saturate(145%);
}

.inbox-grid { min-height: calc(100vh - 142px); }

.mobile-nav-toggle,
.mobile-nav-scrim {
  display: none;
}

.workspace-loading {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 80;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #526f78;
  background: rgba(241, 248, 248, .72);
  backdrop-filter: blur(24px);
  font-size:13px;
  font-weight:700;
}

.workspace-loading i {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(41, 127, 148, .18);
  border-top-color: #297f94;
  border-radius: 50%;
  animation: vista-loading-spin .8s linear infinite;
}

@keyframes vista-loading-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .app-backdrop i { animation: none; }
  .workspace-loading i { animation-duration: 1.8s; }
  .sidebar-panel,
  .workspace-sidebar .brand strong,
  .workspace-sidebar .nav-label,
  .sidebar-workspace { transition: none; }
}

/* The React rail is gone at 840px (styles.css owns that one breakpoint), so the column it
   sat in has to close at the same width or the workspace starts 60px in from nothing. */
@media (max-width: 840px) {
  body.react-navigation-ready .workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  body.react-navigation-ready .mobile-nav-toggle { display: none; }

  .mobile-nav-toggle {
    display: grid;
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    z-index: 40;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius:14px;
    color: #315963;
    background: rgba(255, 255, 255, .64);
    box-shadow: 0 10px 28px rgba(40, 69, 84, .15), inset 0 1px 0 rgba(255, 255, 255, .95);
    backdrop-filter: blur(24px);
  }

  .mobile-nav-toggle .nav-badge { top: -4px; right: -5px; }

  .mobile-nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 44;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(23, 50, 58, .2);
    backdrop-filter: blur(16px);
  }

  .workspace-sidebar {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 45;
    width: min(86vw, 330px);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform .3s ease;
  }

  .workspace.mobile-nav-open .workspace-sidebar { transform: translateX(0); }

  .workspace-sidebar .sidebar-panel,
  .workspace-sidebar .sidebar-panel:hover,
  .workspace-sidebar .sidebar-panel:focus-within {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
    border-width: 0 1px 0 0;
    border-radius: 0 20px 20px 0;
    background: rgba(244, 251, 250, .9);
  }

  .workspace-sidebar .brand strong,
  .workspace-sidebar .nav-label,
  .workspace-sidebar .sidebar-workspace {
    opacity: 1;
    transform: none;
  }

  .workspace-sidebar nav button,
  .workspace-sidebar .quiet {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 7px;
  }

  .content { padding: calc(env(safe-area-inset-top) + 22px) 12px 28px; }
  .content > header { padding-left: 56px; }
  .page-heading h1 { font-size:27px; }
  .header-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .inbox-grid { min-height: 620px; }
}
