/* Topbar and navigation cleanup: keep search, account and the long rail within reach. */
.rail {
  height: 100dvh !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}
.rail-nav {
  flex: 1 1 0% !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(169,154,255,.28) transparent;
}
.account-link {
  flex: 0 0 auto !important;
  margin: 8px 0 0 !important;
  min-height: 58px !important;
  border-top: 1px solid var(--blocky-line) !important;
  border-radius: 0 !important;
  background: #09090b !important;
}

.topbar {
  display: grid !important;
  grid-template-columns: minmax(125px, auto) minmax(260px, 1fr) auto !important;
  align-items: center !important;
  gap: clamp(16px, 2vw, 32px) !important;
}
.topbar > div:first-of-type { min-width: 0 !important; }
.workspace-command {
  justify-self: center !important;
  width: min(100%, 560px) !important;
  min-width: 0 !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 8px 0 13px !important;
  gap: 10px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 3px !important;
  background: #101014 !important;
  color: #c7c3d1 !important;
}
.workspace-command:focus-within {
  border-color: rgba(169,154,255,.72) !important;
  background: #13121a !important;
  box-shadow: 0 0 0 3px rgba(128,108,242,.12) !important;
}
.workspace-command > .ui-icon { width: 16px !important; height: 16px !important; flex: 0 0 16px !important; color: #b7aaff !important; }
.workspace-command input {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #f2f0f7 !important;
  box-shadow: none !important;
  font: inherit !important;
  font-size: 12px !important;
}
.workspace-command input::placeholder { color: #888591 !important; opacity: 1; }
.workspace-command input::-webkit-search-cancel-button { cursor: pointer; }
.workspace-command kbd {
  flex: 0 0 auto;
  margin: 0 2px 0 auto !important;
  padding: 4px 6px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 2px !important;
  color: #aaa6b5 !important;
  font-size: 10px !important;
  line-height: 1 !important;
}
.top-actions { min-width: max-content !important; gap: 8px !important; }

@media (max-width: 1100px) and (min-width: 901px) {
  .topbar { grid-template-columns: minmax(115px, auto) minmax(190px, 1fr) auto !important; gap: 14px !important; padding-inline: 18px !important; }
  .workspace-command { width: 100% !important; }
}
@media (max-width: 900px) {
  .workspace-command {
    display: flex !important;
    justify-self: stretch !important;
    width: auto !important;
    height: 40px !important;
  }
  .topbar { grid-template-columns: auto minmax(0,1fr) auto !important; gap: 10px !important; }
  .topbar > div:first-of-type { display: none !important; }
  .topbar .mobile-brand { min-width: 62px !important; }
  .top-actions { gap: 6px !important; }
  .workspace-command kbd { display: none !important; }
}
@media (max-width: 520px) {
  .topbar { grid-template-columns: auto minmax(0,1fr) auto !important; gap: 7px !important; padding-inline: 9px !important; }
  .topbar .mobile-brand { min-width: 0 !important; gap: 5px !important; font-size: 17px !important; }
  .topbar .mobile-brand img { width: 20px !important; height: 20px !important; }
  .workspace-command { padding-inline: 8px !important; gap: 7px !important; }
  .workspace-command input { font-size: 11px !important; }
  .top-actions { gap: 5px !important; }
  .top-actions .app-bag-button, .top-actions .notification-button { width: 36px !important; min-width: 36px !important; height: 36px !important; }
}

/* Search suggestions stay attached to the command field without shifting the header. */
.workspace-command { position: relative !important; }
.workspace-command:focus-within {
  border-color: rgba(255,255,255,.14) !important;
  background: #101014 !important;
  box-shadow: none !important;
}
.workspace-command:has(input:focus-visible) {
  outline: 2px solid rgba(169,154,255,.82) !important;
  outline-offset: 3px !important;
}
.workspace-search-suggestions {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(60vh, 420px);
  overflow: auto;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  background: #111015;
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
  color: #f2f0f7;
}
.workspace-search-suggestions[hidden] { display: none !important; }
.workspace-search-group-label {
  padding: 8px 9px 5px;
  color: #aaa6b5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.workspace-search-option {
  display: grid;
  width: 100%;
  grid-template-columns: 20px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #f2f0f7;
  text-align: left;
  cursor: pointer;
}
.workspace-search-option:hover,
.workspace-search-option:focus-visible { outline: none; background: #201d2b; }
.workspace-search-option-icon { display: grid; place-items: center; color: #b7aaff; }
.workspace-search-option-icon .ui-icon { width: 16px; height: 16px; }
.workspace-search-option > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.workspace-search-option strong { overflow: hidden; color: #f2f0f7; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.workspace-search-option small { overflow: hidden; color: #b0acb9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-search-option-hint { color: #aaa6b5; font-size: 10px; }
.workspace-search-empty,
.workspace-search-loading { padding: 7px 10px 11px; color: #b0acb9; font-size: 11px; }

/* Keep button icons, remove the decorative frames around them. */
.app-shell :is(.solid-button, .outline-button) > .ui-icon {
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: currentColor !important;
  flex: 0 0 16px !important;
}
.app-shell .outline-button:hover:not(:disabled) > .ui-icon { background: transparent !important; }
.screen[data-screen="home"] .store-tools-sector-grid button {
  grid-template-columns: 24px minmax(0,1fr) !important;
  column-gap: 12px !important;
}
.screen[data-screen="home"] .store-tools-sector-grid button > span {
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #b7aaff !important;
}
.screen[data-screen="home"] .store-tools-sector-grid button > span > .ui-icon { width: 18px; height: 18px; }
.screen[data-screen="home"] .store-tools-sector-grid button > strong,
.screen[data-screen="home"] .store-tools-sector-grid button > small { margin-left: 0 !important; }
#storeOpsContent .merchant-toolkit-grid button > i {
  width: 20px !important;
  height: 20px !important;
  border: 0 !important;
  background: transparent !important;
}
@media (max-width: 900px) {
  .workspace-search-suggestions { max-height: min(58vh, 360px); }
}

/* Keep the search field visually steady when clicked, including Safari's search input. */
.workspace-command:has(input:focus-visible) { outline: none !important; outline-offset: 0 !important; }
.workspace-command > input,
.workspace-command > input:focus,
.workspace-command > input:focus-visible,
.workspace-command > input:active {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  border-inline-start: 0 !important;
  background: transparent !important;
}

#workspaceSearchForm:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border-color: rgba(255,255,255,.14) !important;
  background: #101014 !important;
}
#workspaceSearchForm #workspaceSearchInput,
#workspaceSearchForm #workspaceSearchInput:focus,
#workspaceSearchForm #workspaceSearchInput:focus-visible,
#workspaceSearchForm #workspaceSearchInput:active {
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
