.app-shell {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 23.75rem;
  grid-template-rows: 52px minmax(0, 1fr);
  height: 100dvh;
  background: var(--agent-bg);
}

.app-shell__main {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  background: var(--agent-surface);
  border-left: 1px solid var(--agent-line);
  border-right: 1px solid var(--agent-line);
}

#app_topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: block;
}

#app_center {
  height: 100%;
  display: block;
}

#app_sidepanel {
  grid-column: 3;
  grid-row: 2;
  min-width: 0;
  display: block;
}

.agent-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px 0 9px;
  background: #fff;
  border-bottom: 1px solid #ecedf0;
  color: var(--agent-text);
  z-index: 2;
}

.agent-topbar__left {
  display: flex;
  align-items: center;
  height: 34px;
}

.agent-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  height: 32px;
  padding: 6px 8px 6px 10px;
  border-radius: 0.55rem;
  color: var(--agent-text);
}

.agent-topbar__brand:hover,
.agent-topbar__switch:hover,
.agent-topbar__button:hover {
  background: #f5f6f8;
}

.agent-topbar__home {
  display: inline-grid;
  place-items: center;
  color: #2f8b68;
}

.agent-topbar__home .hi {
  width: 1rem;
  height: 1rem;
}

.agent-topbar__name {
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.agent-topbar__switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.agent-topbar__switch svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.agent-topbar__switcher {
  position: static;
}

.agent-topbar__switcher-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.agent-topbar__switcher-panel {
  position: absolute;
  top: 54px;
  left: 14px;
  z-index: 50;
  width: 340px;
  overflow: hidden;
  border: 1px solid #e6e8eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 40px rgb(16 24 40 / 0.16);
  animation: panelIn 0.14s ease both;
}

.agent-topbar__switcher-search-wrap {
  padding: 12px 14px 10px;
  border-bottom: 1px solid #f0f1f3;
}

.agent-topbar__switcher-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: #f4f5f6;
  color: #9ca3af;
}

.agent-topbar__switcher-search svg {
  flex: none;
}

.agent-topbar__switcher-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  font-size: 14px;
}

.agent-topbar__switcher-input::-webkit-search-cancel-button {
  appearance: none;
}

.agent-topbar__switcher-list {
  max-height: 340px;
  overflow: auto;
  padding: 6px;
}

.agent-topbar__switcher-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 8px;
  border-radius: 10px;
  color: #1f2937;
}

.agent-topbar__switcher-row:hover,
.agent-topbar__switcher-row.is-active {
  background: #f6f7f8;
}

.agent-topbar__switcher-row > svg {
  flex: none;
}

.agent-topbar__switcher-row-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
}

.agent-topbar__switcher-row-name {
  min-width: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.agent-topbar__switcher-check {
  flex: none;
  display: inline-flex;
  color: #9ca3af;
}

.agent-topbar__switcher-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid #bde7d2;
  border-radius: 999px;
  background: #edf9f2;
  color: #2f8b68;
  font-size: 11px;
  font-weight: 500;
}

.agent-topbar__switcher-pill--personal {
  border-color: #d8def8;
  background: #f0f3ff;
  color: #3659c9;
}

.agent-topbar__switcher-empty {
  padding: 18px 12px;
  color: #9ca3af;
  font-size: 13.5px;
  text-align: center;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.agent-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.agent-topbar__org-switcher {
  min-width: 9rem;
}

.agent-topbar__button {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid #e6e8ed;
  border-radius: 0.55rem;
  background: #fff;
  color: #6b7280;
}

.agent-rail {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 58px;
  padding: 12px 0;
  background: #fff;
  border-right: 1px solid #ecedf0;
}

.agent-rail__top,
.agent-rail__nav,
.agent-rail__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.agent-rail__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #6b7280;
  border-radius: 10px;
}

.agent-rail__icon svg {
  width: 20px;
  height: 20px;
}

.agent-rail__icon:hover {
  background: #f5f6f8;
  color: #111827;
}

.agent-rail__icon.is-active {
  background: #f5f6f8;
  color: #3659c9;
}

.agent-rail__icon--personal.is-active {
  background: #eef2ff;
  color: #3659c9;
}

.agent-rail__icon--studio.is-active {
  background: #eef2ff;
  color: #3659c9;
}

.agent-rail__bottom {
  width: 34px;
  gap: 13px;
}

.agent-rail__user-button {
  width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
}

.agent-rail__avatar {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe3e8;
  border-radius: 9999px;
  background: #edeff2;
  color: #4b5563;
  font-size: 10px;
  font-weight: 500;
}

.agent-rail__avatar-chevron {
  position: absolute;
  right: 0;
  bottom: 5px;
  width: 10px;
  height: 10px;
}

.agent-rail__avatar--dark {
  width: 28px;
  height: 28px;
  background: #243b63;
  color: #fff;
  border-color: #243b63;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  #app_sidepanel {
    display: none;
  }
}

@media (max-width: 640px) {
  .agent-rail {
    display: none;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell__main {
    grid-column: 1;
  }
}
