/* Desktop topbar: one quiet navigation surface and one cohesive action island. */
/* Desktop entry stays desktop at every window width; mobile is selector-scoped. */
@media all {
  html:not([data-mobile-workbench="true"]) .topbar {
    gap: 10px !important;
    border-bottom: 0 !important;
    background: #f1f4f9 !important;
    box-shadow: none !important;
    backdrop-filter: blur(18px) saturate(130%) !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-template-marketplace-entry {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 118px !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 15px !important;
    gap: 7px !important;
    border: 0 !important;
    border-radius: 11px !important;
    color: #17191f !important;
    background: #d2ff3f !important;
    background-image: none !important;
    box-shadow:
      0 1px 1px rgba(79, 102, 8, 0.12),
      0 6px 16px rgba(113, 145, 17, 0.13) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0.01em !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-template-marketplace-entry > .lucide:first-child {
    width: 16px !important;
    height: 16px !important;
    flex: 0 0 16px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: #17191f !important;
    background: transparent !important;
    box-shadow: none !important;
    stroke-width: 2 !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-template-marketplace-entry:hover {
    border: 0 !important;
    color: #111318 !important;
    background: #c8f332 !important;
    background-image: none !important;
    box-shadow:
      0 1px 1px rgba(79, 102, 8, 0.12),
      0 8px 20px rgba(113, 145, 17, 0.17) !important;
    filter: none !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-template-marketplace-entry:active,
  html:not([data-mobile-workbench="true"]) #topbar-template-marketplace-entry.is-active {
    border: 0 !important;
    color: #111318 !important;
    background: #bfee29 !important;
    background-image: none !important;
    box-shadow: 0 1px 2px rgba(79, 102, 8, 0.16) !important;
    filter: none !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-template-marketplace-entry:focus-visible {
    border: 0 !important;
    color: #111318 !important;
    background: #d2ff3f !important;
    background-image: none !important;
    box-shadow:
      0 0 0 3px rgba(210, 255, 63, 0.4),
      0 6px 16px rgba(113, 145, 17, 0.13) !important;
    outline: none !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-patchy-entry {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 122px !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 14px 0 10px !important;
    gap: 8px !important;
    border: 1px solid rgba(73, 135, 214, 0.26) !important;
    border-radius: 11px !important;
    color: #07314d !important;
    background: #94c0ff !important;
    background-image: none !important;
    box-shadow:
      0 1px 1px rgba(36, 86, 148, 0.12),
      0 7px 16px rgba(73, 135, 214, 0.2) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, filter 160ms ease !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-patchy-entry > .topbar-patchy-mark {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
    padding: 0 !important;
    border: 1px solid rgba(49, 168, 255, 0.62) !important;
    border-radius: 6px !important;
    color: #31a8ff !important;
    background: #001e36 !important;
    box-shadow: 0 1px 3px rgba(0, 20, 38, 0.34) !important;
    box-sizing: border-box !important;
    font-family: Inter, "Segoe UI", Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: -0.03em !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-patchy-entry:hover {
    border-color: rgba(63, 124, 202, 0.42) !important;
    color: #062b44 !important;
    background: #88b7f7 !important;
    background-image: none !important;
    box-shadow:
      0 1px 1px rgba(36, 86, 148, 0.14),
      0 9px 20px rgba(73, 135, 214, 0.25) !important;
    filter: none !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-patchy-entry:hover > .topbar-patchy-mark {
    border-color: rgba(103, 196, 255, 0.78) !important;
    color: #67c4ff !important;
    background: #001e36 !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-patchy-entry:active {
    border-color: rgba(63, 124, 202, 0.5) !important;
    color: #062b44 !important;
    background: #7eadef !important;
    background-image: none !important;
    box-shadow: 0 2px 5px rgba(36, 86, 148, 0.22) !important;
    filter: none !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) #topbar-patchy-entry:focus-visible {
    border-color: rgba(63, 124, 202, 0.56) !important;
    color: #07314d !important;
    background: #94c0ff !important;
    background-image: none !important;
    box-shadow:
      0 0 0 3px rgba(73, 135, 214, 0.24),
      0 7px 16px rgba(73, 135, 214, 0.2) !important;
    outline: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar > .topbar-need-request-entry {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 0 15px !important;
    gap: 7px !important;
    border: 1px solid rgba(17, 19, 27, 0.92) !important;
    border-radius: 11px !important;
    color: #ffffff !important;
    background: #17191f !important;
    background-image: none !important;
    box-shadow:
      0 1px 1px rgba(15, 23, 42, 0.1),
      0 6px 16px rgba(15, 23, 42, 0.1) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    letter-spacing: 0.01em !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar > .topbar-need-request-entry > .lucide:first-child {
    width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: #d2ff3f !important;
    background: transparent !important;
    box-shadow: none !important;
    stroke-width: 2 !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar > .topbar-need-request-entry:hover {
    border-color: #252833 !important;
    color: #ffffff !important;
    background: #252832 !important;
    box-shadow:
      0 1px 1px rgba(15, 23, 42, 0.1),
      0 8px 20px rgba(15, 23, 42, 0.14) !important;
    filter: none !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar > .topbar-need-request-entry:active {
    color: #ffffff !important;
    background: #101218 !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14) !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar > .topbar-need-request-entry:focus-visible {
    border-color: #17191f !important;
    color: #ffffff !important;
    background: #17191f !important;
    box-shadow:
      0 0 0 3px rgba(210, 255, 63, 0.38),
      0 6px 16px rgba(15, 23, 42, 0.12) !important;
    outline: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions {
    position: relative !important;
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: 0 !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 3px !important;
    overflow: visible !important;
    border: 1px solid rgba(117, 127, 149, 0.16) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.035),
      0 7px 22px rgba(55, 65, 81, 0.055),
      0 1px 0 rgba(255, 255, 255, 0.9) inset !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions > button {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 30px !important;
    height: 30px !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 8px !important;
    color: #626c7d !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    filter: none !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions > button:hover {
    color: #252b38 !important;
    background: rgba(88, 75, 145, 0.07) !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions > button:active {
    color: #20242e !important;
    background: rgba(88, 75, 145, 0.11) !important;
    transform: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions > button:focus-visible {
    color: #252b38 !important;
    background: rgba(88, 75, 145, 0.08) !important;
    box-shadow: 0 0 0 2px rgba(112, 93, 214, 0.28) inset !important;
    outline: none !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions > :is(.points-button, .checkin-entry-button, .notify-button, .shop-button) {
    margin-left: 1px !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions > :is(.points-button, .checkin-entry-button, .notify-button, .shop-button)::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 8px;
    width: 1px;
    height: 14px;
    background: rgba(117, 127, 149, 0.14);
    pointer-events: none;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions > button:hover::before,
  html:not([data-mobile-workbench="true"]) .topbar .top-actions > button:focus-visible::before {
    opacity: 0;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions .workspace-theme-toggle {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions .points-button strong {
    color: #6657d8 !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    font-variant-numeric: tabular-nums !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions .notify-button {
    width: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions .shop-button {
    min-width: 100px !important;
    padding-right: 8px !important;
    padding-left: 8px !important;
    text-align: left !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions .shop-button span,
  html:not([data-mobile-workbench="true"]) .topbar .top-actions .shop-button b {
    color: #252b38 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions .account-entry-avatar {
    width: 22px !important;
    height: 22px !important;
    border: 1px solid rgba(117, 127, 149, 0.12) !important;
    color: #667085 !important;
    background: rgba(239, 242, 247, 0.9) !important;
  }

  html:not([data-mobile-workbench="true"]) .topbar .top-actions :is(.workspace-theme-toggle, .points-button, .checkin-entry-button) > .lucide:first-child,
  html:not([data-mobile-workbench="true"]) .topbar .top-actions .notify-button .lucide,
  html:not([data-mobile-workbench="true"]) .topbar .top-actions .shop-button > .lucide:last-child {
    color: #778195 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar {
    border-bottom: 0 !important;
    background: linear-gradient(90deg, rgba(20, 21, 27, 0.97), rgba(25, 24, 33, 0.96)) !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar .top-actions {
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(37, 38, 48, 0.76) !important;
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 8px 24px rgba(0, 0, 0, 0.16),
      0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) #topbar-patchy-entry {
    border-color: rgba(103, 164, 244, 0.4) !important;
    color: #07314d !important;
    background: #94c0ff !important;
    background-image: none !important;
    box-shadow: 0 7px 18px rgba(0, 18, 34, 0.34) !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) #topbar-patchy-entry > .topbar-patchy-mark {
    border-color: rgba(103, 196, 255, 0.68) !important;
    color: #53b8ff !important;
    background: #001a30 !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) #topbar-patchy-entry:hover,
  html[data-theme="dark"]:not([data-mobile-workbench="true"]) #topbar-patchy-entry:focus-visible {
    border-color: rgba(103, 164, 244, 0.56) !important;
    color: #062b44 !important;
    background: #88b7f7 !important;
    background-image: none !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar .top-actions > button {
    color: #b8becb !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar .top-actions > button:hover,
  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar .top-actions > button:focus-visible {
    color: #f2f4f8 !important;
    background: rgba(255, 255, 255, 0.08) !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar .top-actions .shop-button span,
  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar .top-actions .shop-button b {
    color: #f2f4f8 !important;
  }

  html[data-theme="dark"]:not([data-mobile-workbench="true"]) .topbar .top-actions .account-entry-avatar {
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #bec5d2 !important;
    background: rgba(255, 255, 255, 0.07) !important;
  }
}

html[data-mobile-workbench="true"] #topbar-patchy-entry {
  display: none !important;
}

@media (max-width: 980px) {
  #topbar-patchy-entry {
    display: none !important;
  }
}

/* Keep the retired Agent launcher out of the public top navigation even when
   an older cached Agent script still inserts the button. */
html body .topbar .top-library-tabs > button.top-agent-conversation-entry[data-agent-conversation-launch]:not([hidden]) {
  display: none !important;
  position: absolute !important;
  inline-size: 0 !important;
  block-size: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
