.toolbar-stack {
  --toolbar-outline: #ffffff29;
  --toolbar-surface: rgba(22, 24, 38, .9);
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: max-content;
  max-width: calc(100vw - 24px);
  padding-top: 44px;
  transform: translateX(-50%);
}
.toolbar-stack::before {
  position: absolute;
  z-index: 2;
  top: 29px;
  left: 50%;
  width: 76px;
  height: 16px;
  transform: translateX(-50%);
  border: 1px solid var(--toolbar-outline);
  border-bottom: 0;
  border-radius: 38px 38px 0 0;
  background: var(--toolbar-surface);
  content: "";
  pointer-events: none;
}
.showcase-app.has-open-help .toolbar-stack { z-index: 72; }
.showcase-app.has-open-help .floating-toolbar { pointer-events: none; }
.showcase-app.has-open-help .preview-stage,
.showcase-app.has-open-help .storefront { overflow: hidden; }

.toolbar-stack .floating-toolbar {
  position: relative;
  z-index: 1;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: max-content;
  max-width: 100%;
  transform: none;
  border: 1px solid var(--toolbar-outline);
  background: var(--toolbar-surface);
  box-shadow: 0 18px 48px #0c0d1c63, inset 0 1px #ffffff16;
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}
.toolbar-stack .toolbar-divider { background: #ffffff30; }
.toolbar-stack .device-switch { border-color: #ffffff28; background: #ffffff0d; }
.toolbar-stack .device-button { color: #e2dce0; font-weight: 650; }
.toolbar-stack .device-button:hover,
.toolbar-stack .device-button:focus-visible { background: #ffffff1b; color: #fff; }
.toolbar-stack .device-button.is-active,
.toolbar-stack .device-button.is-active:hover { background: #e6cfb0; color: #302636; box-shadow: 0 4px 14px #040d0940; }
.toolbar-stack .admin-toolbar-button { border-color: #ffffff30; background: #ffffff12; color: #ede6e5; }
.toolbar-stack .admin-toolbar-button[hidden], .toolbar-stack:has(.admin-toolbar-button[hidden]) .toolbar-divider { display: none; }
.toolbar-stack .admin-toolbar-button:hover { background: #ffffff24; color: #fff; }
.toolbar-stack :is(.admin-toolbar-button, .device-button, .help-trigger):focus-visible { outline: 2px solid #ead0a7; outline-offset: 3px; }
.showcase-app.has-open-admin .toolbar-stack .admin-toolbar-button { justify-content: center; border-color: #ead6be; background: #e6cfb0; color: #302636; font-size: 14px; }
.showcase-app.has-open-admin .toolbar-stack .admin-toolbar-button:hover { background: #f0dbc0; color: #302636; }

.help-trigger {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  transform: translateX(-50%);
  border: 1px solid var(--toolbar-outline);
  border-radius: 50%;
  background: #282336;
  box-shadow: 0 9px 26px #0c0d1c7a, inset 0 1px #ffffff20;
  color: #e6cfb0;
  font-size: 21px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.help-trigger::after {
  position: absolute;
  inset: -4px;
  border: 2px solid #e6cfb09c;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  animation: help-pulse 2.8s ease-out infinite;
}
.help-trigger:hover,
.help-trigger[aria-expanded="true"] { transform: translateX(-50%) translateY(-3px); background: #383047; box-shadow: 0 13px 30px #0c0d1c8c, inset 0 1px #ffffff28; }
.help-trigger[aria-expanded="true"]::after { animation: none; opacity: 0; }
@keyframes help-pulse {
  0% { transform: scale(.92); opacity: .72; }
  75%, 100% { transform: scale(1.45); opacity: 0; }
}

.help-backdrop {
  position: fixed;
  z-index: 71;
  inset: 0;
  background: rgba(10, 9, 19, .62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .22s ease;
}
.help-backdrop[hidden], .help-tour[hidden] { display: none; }
.help-backdrop.is-open { opacity: 1; }

.help-tour {
  position: absolute;
  z-index: 4;
  bottom: calc(100% + 12px);
  left: 50%;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 155px);
  overflow-y: auto;
  padding: 21px 23px 20px;
  transform: translateX(-50%) translateY(14px) scale(.98);
  transform-origin: bottom center;
  border: 1px solid #ffffff36;
  border-radius: 17px;
  background: rgba(27, 25, 39, .97);
  box-shadow: 0 24px 70px #090815aa, inset 0 1px #ffffff1c;
  color: #f5f2ef;
  font: 14px/1.5 Inter, "DM Sans", system-ui, sans-serif;
  opacity: 0;
  overscroll-behavior: contain;
  transition: opacity .22s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.help-tour.is-open { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
.help-tour-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #d5bbbd; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.help-tour-close { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #ffffff2c; border-radius: 8px; background: #ffffff10; color: #f2ecea; cursor: pointer; }
.help-tour-close:hover { background: #ffffff24; }
.help-tour-illustration { display: flex; align-items: flex-end; justify-content: space-between; margin: 19px 0 12px; }
.help-tour-icon { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #e6cfb06b; border-radius: 14px; background: #e6cfb0; color: #302636; font-size: 23px; }
.help-tour-step { color: #d5c0c5; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.help-tour h2 { margin: 0 0 9px; color: #fff; font-size: clamp(22px, 4vw, 27px); line-height: 1.14; letter-spacing: -.035em; }
.help-tour h2:focus { outline: none; }
.help-tour > p { margin: 0; color: #d5cbd2; font-size: 14px; line-height: 1.55; }
.help-tour ul { display: grid; gap: 8px; margin: 17px 0 22px; padding: 0; list-style: none; }
.help-tour li { display: flex; gap: 9px; color: #eee7e9; font-size: 13px; line-height: 1.45; }
.help-tour li::before { flex: 0 0 6px; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: #e6cfb0; content: ""; }
.help-tour-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid #ffffff24; }
.help-tour-dots { display: flex; gap: 5px; }
.help-tour-dots span { width: 6px; height: 6px; border-radius: 6px; background: #ffffff50; transition: width .18s ease, background .18s ease; }
.help-tour-dots span.is-current { width: 16px; background: #e6cfb0; }
.help-tour-actions { display: flex; gap: 8px; }
.help-tour-actions button { min-height: 35px; padding: 0 12px; border: 1px solid #ffffff35; border-radius: 8px; background: #ffffff10; color: #f2ecea; font-size: 12px; font-weight: 750; cursor: pointer; }
.help-tour-actions button:hover:not(:disabled) { background: #ffffff24; }
.help-tour-actions button:disabled { opacity: .35; cursor: default; }
.help-tour-actions [data-help-next] { display: inline-flex; align-items: center; gap: 8px; border-color: #e6cfb0; background: #e6cfb0; color: #302636; }
.help-tour-actions [data-help-next]:hover { background: #f0dbc0; }
.help-tour :is(button, h2):focus-visible { outline: 2px solid #ead0a7; outline-offset: 3px; }

@media (max-width: 760px) {
  .preview-stage { bottom: calc(50px + env(safe-area-inset-bottom, 0px)); height: auto; }
  .toolbar-stack { right: 0; bottom: 0; left: 0; width: 100%; max-width: none; transform: none; }
  .toolbar-stack .floating-toolbar { justify-content: space-between; gap: 4px; width: 100%; max-width: none; padding: 5px 10px calc(5px + env(safe-area-inset-bottom, 0px)); border: 0; border-top: 1px solid #ffffff29; border-radius: 0; box-shadow: none; }
  .browser-frame[data-device="mobile"],
  .browser-frame[data-device="tablet"] { height: min(844px, calc(100% - 24px)); }
  .storefront { padding-bottom: 12px; scroll-padding-bottom: 12px; }
}
@media (min-width: 601px) and (max-width: 1024px) {
  .device-button[data-device="desktop"] { display: none; }
}
@media (max-width: 600px) {
  .toolbar-stack .floating-toolbar { justify-content: center; }
  .toolbar-stack .device-switch,
  .toolbar-stack .toolbar-divider { display: none; }
  .toolbar-stack:has(.admin-toolbar-button[hidden]) { bottom: 12px; height: 48px; padding-top: 0; }
  .toolbar-stack:has(.admin-toolbar-button[hidden])::before { display: none; }
  .toolbar-stack:has(.admin-toolbar-button[hidden]) .floating-toolbar { display: none; }
  .showcase-app:has(.admin-toolbar-button[hidden]) .preview-stage { bottom: 0; }
  .help-tour { max-height: calc(100dvh - 125px); padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .help-trigger, .help-backdrop, .help-tour, .help-tour-dots span { transition: none; }
  .help-trigger::after { animation: none; opacity: 0; }
}
