:root {
  --nb-guide-accent: var(--primary, #7650d7);
  --nb-guide-dark: #111827;
  --nb-guide-text: #f8fafc;
  --nb-guide-muted: #cbd5e1;
  --nb-guide-shadow: 0 22px 60px rgba(15, 23, 42, .28);
}

/* Shared help triggers */
.nb-help-host {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.nb-help-trigger {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-inline-start: .3rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--nb-guide-accent) 30%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--nb-guide-accent) 11%, white);
  color: var(--nb-guide-accent);
  font: 800 .72rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: help;
  vertical-align: middle;
  touch-action: manipulation;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.nb-help-trigger[data-icon="?"] {
  background: var(--nb-guide-accent);
  color: white;
  border-color: var(--nb-guide-accent);
}
.nb-help-trigger:hover,
.nb-help-trigger:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--nb-guide-accent) 24%, transparent);
  outline: none;
}
.nb-help-trigger:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nb-guide-accent) 24%, transparent);
}
.nb-help-trigger[aria-expanded="true"] {
  background: var(--nb-guide-accent);
  color: white;
  border-color: var(--nb-guide-accent);
}

/* Click/tap information bubble */
.nb-help-popover {
  position: fixed;
  z-index: 11020;
  width: min(360px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  background: var(--nb-guide-dark);
  color: var(--nb-guide-text);
  box-shadow: var(--nb-guide-shadow);
  opacity: 0;
  transform: translateY(6px) scale(.985);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.nb-help-popover.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.nb-help-popover::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--nb-guide-dark);
  transform: rotate(45deg);
}
.nb-help-popover[data-placement="top"]::after {
  left: var(--nb-arrow-x, 50%);
  bottom: -7px;
  margin-left: -7px;
}
.nb-help-popover[data-placement="bottom"]::after {
  left: var(--nb-arrow-x, 50%);
  top: -7px;
  margin-left: -7px;
}
.nb-help-popover[data-placement="left"]::after {
  right: -7px;
  top: var(--nb-arrow-y, 50%);
  margin-top: -7px;
}
.nb-help-popover[data-placement="right"]::after {
  left: -7px;
  top: var(--nb-arrow-y, 50%);
  margin-top: -7px;
}
.nb-help-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.nb-help-popover h3 {
  margin: 0;
  color: white;
  font-size: 1rem;
  line-height: 1.3;
}
.nb-help-popover p {
  margin: 10px 0 0;
  color: var(--nb-guide-muted);
  font-size: .86rem;
  line-height: 1.55;
}
.nb-help-popover-note {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(255,255,255,.075);
  color: #e2e8f0;
  font-size: .78rem;
  line-height: 1.45;
}
.nb-help-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 15px;
}
.nb-help-popover button {
  min-height: 36px;
}
.nb-help-popover-close {
  appearance: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255,255,255,.08);
  color: white;
  font-size: 1.15rem;
  cursor: pointer;
}
.nb-help-popover-close:focus-visible,
.nb-help-popover-actions button:focus-visible {
  outline: 3px solid rgba(125, 211, 252, .55);
  outline-offset: 2px;
}
.nb-help-popover .nb-popover-tour {
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: #38bdf8;
  color: #082f49;
  font-weight: 800;
  cursor: pointer;
}

/* Per-page tutorial launch action */
.nb-page-guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  white-space: nowrap;
}
.nb-page-guide-button .nb-guide-mark {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--nb-guide-accent);
  color: white;
  font-size: .72rem;
  font-weight: 900;
}
.nb-page-guide-button.nb-guide-new::after {
  content: "New";
  margin-left: .15rem;
  padding: .15rem .35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--nb-guide-accent) 14%, white);
  color: var(--nb-guide-accent);
  font-size: .61rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Guided page tour spotlight */
.nb-tour-root {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
}
.nb-tour-shade {
  position: fixed;
  background: rgba(9, 13, 24, .74);
  backdrop-filter: blur(1.5px);
  pointer-events: auto;
}
.nb-tour-focus-ring {
  position: fixed;
  border: 3px solid #7dd3fc;
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(125,211,252,.18), 0 12px 35px rgba(0,0,0,.2);
  pointer-events: none;
  transition: top .26s ease, left .26s ease, width .26s ease, height .26s ease;
}
.nb-tour-target-blocker {
  position: fixed;
  pointer-events: auto;
  background: transparent;
  cursor: default;
}
.nb-tour-card {
  position: fixed;
  z-index: 12005;
  width: min(390px, calc(100vw - 28px));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: var(--nb-guide-dark);
  color: var(--nb-guide-text);
  box-shadow: 0 26px 80px rgba(0,0,0,.38);
  pointer-events: auto;
  overflow: hidden;
  transition: top .24s ease, left .24s ease, transform .18s ease, opacity .18s ease;
}
.nb-tour-card::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--nb-guide-dark);
  transform: rotate(45deg);
}
.nb-tour-card[data-placement="top"]::after {
  left: var(--nb-tour-arrow-x, 50%);
  bottom: -8px;
  margin-left: -8px;
}
.nb-tour-card[data-placement="bottom"]::after {
  left: var(--nb-tour-arrow-x, 50%);
  top: -8px;
  margin-left: -8px;
}
.nb-tour-card[data-placement="left"]::after {
  right: -8px;
  top: var(--nb-tour-arrow-y, 50%);
  margin-top: -8px;
}
.nb-tour-card[data-placement="right"]::after {
  left: -8px;
  top: var(--nb-tour-arrow-y, 50%);
  margin-top: -8px;
}
.nb-tour-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 0;
}
.nb-tour-kicker {
  display: block;
  margin-bottom: 4px;
  color: #7dd3fc;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nb-tour-card h2 {
  margin: 0;
  color: white;
  font-size: 1.06rem;
  line-height: 1.3;
}
.nb-tour-exit {
  appearance: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
}
.nb-tour-copy {
  padding: 12px 18px 16px;
  color: var(--nb-guide-muted);
  font-size: .88rem;
  line-height: 1.58;
}
.nb-tour-copy p { margin: 0; }
.nb-tour-tip {
  display: block;
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(255,255,255,.075);
  color: #e2e8f0;
  font-size: .78rem;
}
.nb-tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px 16px;
  border-top: 1px solid rgba(255,255,255,.09);
}
.nb-tour-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 700;
}
.nb-tour-dots {
  display: flex;
  gap: 4px;
}
.nb-tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.23);
}
.nb-tour-dot.active {
  width: 18px;
  background: #7dd3fc;
}
.nb-tour-controls {
  display: flex;
  gap: 8px;
}
.nb-tour-controls button {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 13px;
  font-weight: 800;
  cursor: pointer;
}
.nb-tour-back {
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: white;
}
.nb-tour-next {
  border: 0;
  background: #38bdf8;
  color: #082f49;
}
.nb-tour-controls button:disabled {
  opacity: .4;
  cursor: default;
}
.nb-tour-card button:focus-visible {
  outline: 3px solid rgba(125,211,252,.6);
  outline-offset: 2px;
}
body.nb-tour-open { overflow: hidden; }

@media (max-width: 760px) {
  .nb-page-guide-button {
    min-width: 42px;
    padding-inline: 10px;
  }
  .nb-page-guide-button .nb-guide-label { display: inline; }
  .nb-page-guide-button.nb-guide-new::after { display: none; }
  .nb-help-popover {
    left: 12px !important;
    right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    width: auto;
    border-radius: 18px;
  }
  .nb-help-popover::after { display: none; }
  .nb-tour-card {
    left: 12px !important;
    right: 12px !important;
    width: auto;
    max-height: min(46vh, 430px);
    overflow-y: auto;
    border-radius: 18px;
  }
  .nb-tour-card::after { display: none; }
  .nb-tour-footer {
    position: sticky;
    bottom: 0;
    background: var(--nb-guide-dark);
  }
  .nb-tour-progress { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 520px) {
  .nb-tour-card-head { padding: 16px 16px 0; }
  .nb-tour-copy { padding: 10px 16px 14px; }
  .nb-tour-footer { padding: 12px 16px max(14px, env(safe-area-inset-bottom)); }
  .nb-tour-dots { display: none; }
  .nb-tour-controls button { min-width: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .nb-help-trigger,
  .nb-help-popover,
  .nb-tour-focus-ring,
  .nb-tour-card {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .nb-help-trigger,
  .nb-help-popover,
  .nb-page-guide-button,
  .nb-tour-root { display: none !important; }
}
