:root {
  --gs-topbar-height: 64px;
  --gs-nav-bg: #211c21;
  --gs-nav-bg-strong: #292229;
  --gs-nav-line: rgba(255, 255, 255, .085);
  --gs-nav-text: #a9a1ab;
  --gs-nav-text-strong: #fff8ff;
  --gs-nav-accent: #ffbe48;
  --gs-nav-green: #52d273;
  --gs-nav-red: #ff6377;
}

.console-shell {
  grid-template-rows: var(--gs-topbar-height) minmax(0, 1fr) 34px;
}

.app-shell {
  grid-template-rows: var(--gs-topbar-height) auto auto auto minmax(0, 1fr) 38px;
}

.gs-topbar {
  position: relative;
  z-index: 90;
  isolation: isolate;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: var(--gs-topbar-height);
  gap: 18px;
  padding: 0 20px;
  border-bottom: 0;
  background:
    radial-gradient(circle at 12% -120%, rgba(255, 190, 72, .2), transparent 52%),
    linear-gradient(180deg, var(--gs-nav-bg-strong), var(--gs-nav-bg));
  box-shadow: 0 10px 34px rgba(0, 0, 0, .17);
  color: var(--gs-nav-text-strong);
}

.gs-topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 190, 72, .22), transparent);
  pointer-events: none;
}

.gs-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--gs-nav-text-strong);
  text-decoration: none;
  white-space: nowrap;
}

.gs-brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, #ffd76f, #efa72e 72%);
  box-shadow: 0 7px 22px rgba(255, 190, 72, .2), inset 0 1px rgba(255, 255, 255, .4);
  color: #211605;
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  transition: transform 220ms ease-in-out, box-shadow 220ms ease-in-out;
}

.gs-brand:hover .gs-brand-mark {
  transform: translateY(-1px) rotate(-2deg);
  box-shadow: 0 10px 28px rgba(255, 190, 72, .3), inset 0 1px rgba(255, 255, 255, .48);
}

.gs-brand strong {
  overflow: hidden;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
}

.gs-nav-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.gs-nav {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.gs-nav::-webkit-scrollbar { display: none; }

.gs-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  color: var(--gs-nav-text);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 220ms ease-in-out, background 220ms ease-in-out, transform 220ms ease-in-out;
}

.gs-nav-link::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 3px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--gs-nav-accent);
  opacity: 0;
  transform: scaleX(.3);
  transition: opacity 220ms ease-in-out, transform 220ms ease-in-out;
}

.gs-nav-link:hover {
  background: rgba(255, 255, 255, .055);
  color: var(--gs-nav-text-strong);
  transform: translateY(-1px);
}

.gs-nav-link.active,
.gs-nav-link[aria-current="page"] {
  background: rgba(255, 190, 72, .11);
  color: #ffd477;
}

.gs-nav-link.active::after,
.gs-nav-link[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.gs-nav-link.is-highlight {
  background: rgba(255, 190, 72, .07);
}

.gs-nav-step {
  display: none;
  place-items: center;
  width: 30px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  color: #ded6df;
  cursor: pointer;
  transition: opacity 180ms ease-in-out, background 180ms ease-in-out, color 180ms ease-in-out;
}

.gs-nav-step svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gs-nav-step:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.gs-nav-step:disabled { opacity: .18; pointer-events: none; }

.gs-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.gs-topbar .gs-nav-actions > .gs-action,
.gs-topbar .gs-nav-actions > .account-button {
  display: inline-flex;
}

.gs-action,
.gs-topbar .account-button {
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: #e8e0e9;
  font-size: 11px;
  font-weight: 760;
  text-decoration: none;
  transition: background 200ms ease-in-out, color 200ms ease-in-out;
}

.gs-action:hover,
.gs-topbar .account-button:hover {
  background: rgba(255, 190, 72, .08);
  color: #fff;
}

.gs-topbar .api-health {
  color: #d8d0da !important;
}

.gs-topbar .api-health i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gs-nav-green);
  box-shadow: 0 0 0 3px rgba(82, 210, 115, .11), 0 0 13px rgba(82, 210, 115, .5);
}

.gs-topbar .api-health b { color: #78e894; font-size: 10px; }
.gs-topbar .api-health.is-error i { background: var(--gs-nav-red); box-shadow: 0 0 0 3px rgba(255, 99, 119, .1); }
.gs-topbar .api-health.is-error b { color: #ff8c9b; }
.gs-topbar .ai-link { color: #d8b1ff; }
.gs-topbar .drive-link { color: #ffe2a3 !important; }
.gs-topbar .account-button { margin: 0; cursor: pointer; }
.gs-topbar .account-button b { color: #fff; }

.gs-topbar .gs-notification-toggle {
  border: 0;
  background: rgba(255, 255, 255, .045);
}

.gs-topbar .gs-notification-toggle:hover {
  border: 0;
  background: rgba(255, 190, 72, .09);
}

.gs-nav-link:focus-visible,
.gs-nav-step:focus-visible,
.gs-action:focus-visible,
.gs-topbar .account-button:focus-visible,
.gs-topbar .gs-notification-toggle:focus-visible {
  outline: 2px solid rgba(255, 210, 112, .92);
  outline-offset: 2px;
}

@media (max-width: 1420px) {
  .gs-topbar { gap: 12px; padding-inline: 16px; }
  .gs-nav-link { padding-inline: 9px; }
  .gs-topbar .gs-nav-actions > .ai-link,
  .gs-topbar .gs-nav-actions > .account-button { display: none; }
}

@media (max-width: 1080px) {
  :root { --gs-topbar-height: 108px; }

  .gs-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 56px 52px;
    gap: 0 10px;
    padding: 0 12px;
  }

  .gs-brand { grid-column: 1; grid-row: 1; }
  .gs-nav-actions { grid-column: 3; grid-row: 1; }
  .gs-nav-frame {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 52px;
    border-top: 0;
  }

  .gs-topbar.is-nav-overflowing .gs-nav-step { display: grid; }
  .gs-nav { gap: 3px; padding-inline: 4px; }
  .gs-nav-link { height: 40px; padding-inline: 12px; }
  .gs-topbar .gs-nav-actions > .drive-link { display: none; }
  .app-shell { grid-template-rows: var(--gs-topbar-height) auto auto auto minmax(0, 1fr) 38px; }
}

@media (max-width: 620px) {
  :root { --gs-topbar-height: 100px; }

  .gs-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 52px 48px;
    gap: 0 8px;
    padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
  }

  .gs-brand { min-width: 0; }
  .gs-brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
  .gs-brand strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; }
  .gs-nav-actions {
    display: flex;
    grid-column: 2;
    gap: 0;
  }
  .gs-topbar .gs-nav-actions > * { display: none !important; }
  .gs-topbar .gs-nav-actions > .gs-notification-toggle {
    display: inline-flex !important;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
  }
  .gs-nav-frame { height: 48px; }
  .gs-nav { min-width: 0; padding-inline: 2px; }
  .gs-nav-link { height: 38px; padding-inline: 10px; font-size: 11px; }
  .gs-nav-step { width: 28px; height: 32px; }
  .app-shell { grid-template-rows: var(--gs-topbar-height) auto auto auto minmax(0, 1fr) 32px; }
}

@media (max-width: 360px) {
  .gs-brand strong { font-size: 14px; }
  .gs-nav-link { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .gs-nav,
  .gs-brand-mark,
  .gs-nav-link,
  .gs-nav-link::after,
  .gs-action { scroll-behavior: auto; transition-duration: .01ms; }
}
