/* ── Onboarding coachmark walkthrough (js/onboarding.js) ─────────────────────
   Nav tour on first boot (hint_key 'nav_tour'), plus the generic
   showCoachmark() bubble reused by future per-page action hints. #onboarding-
   scrim/#onboarding-highlight/#onboarding-bubble live once in app/index.html,
   positioned absolutely by JS (clampToViewport(), js/utils.js — the same
   measure-then-clamp approach #notes-popover uses) rather than fixed, so
   these rules only cover appearance, not layout math. The four
   .onboarding-dim-band elements (created lazily in js/onboarding.js — no
   static markup for these) are positioned the same way. */

#onboarding-scrim {
  position: fixed;
  inset: 0;
  z-index: 1099;
  background: transparent;
}

/* Previously the dimmed backdrop and the "spotlight" cutout around the
   target were the same element — a 9999px box-shadow spread painted the
   dimming everywhere outside this box's own bounds. That spread was the
   prime suspect for a mobile-only paint/compositing artifact (coachmark
   bubble titles clipping on real devices — forcing #onboarding-bubble onto
   its own layer, below, didn't fix it), so the dimming now comes from four
   normally-sized .onboarding-dim-band rectangles instead (see
   showCoachmark(), js/onboarding.js) — ordinary box painting, nothing
   relying on an enormous shadow spread. This element is now just a thin
   ring around the target for visual polish; its own box-shadow spread is a
   fixed 2px, nowhere near the size that caused the mobile issue. */
#onboarding-highlight {
  position: absolute;
  z-index: 1100;
  pointer-events: none;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

/* The four rectangles surrounding the cutout (above/below/left/right of the
   highlighted rect) that together dim everything but the current target —
   see #onboarding-highlight above for why this replaced a single giant
   box-shadow spread. Same transition as #onboarding-highlight so all five
   pieces animate together when the target changes between screens. */
.onboarding-dim-band {
  position: absolute;
  z-index: 1100;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.55);
  transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease;
}

#onboarding-bubble {
  position: absolute;
  z-index: 1101;
  width: 280px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  padding: 14px 16px;
  font-family: inherit;
  box-sizing: border-box;
}

/* Only shown for the single-dismiss page-action hints (maybeShowPageHint(),
   js/onboarding.js) — the multi-step nav tour dismisses via Skip instead. */
.ob-bubble-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-tertiary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ob-bubble-close:hover { background: var(--navy-light); color: var(--text-secondary); }

.ob-bubble-step {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.ob-bubble-title {
  /* Sized purely by its own content/font, never by the highlighted target's
     measured rect — checked, and nothing here or in showCoachmark()
     (js/onboarding.js) ever did couple the two; the highlight box (a
     separate element, sized from the target's rect purely for the spotlight
     cutout) was already ruled out as the cause of the mobile
     "Availabili"/"Capta" clipping. text-size-adjust: 100% guards against
     the remaining likely cause — mobile browsers' font-boosting/autosizer
     inflating rendered text past what actually fits the bubble's declared
     width — but this is a hardening measure, not a confirmed fix; re-test
     on device. */
  width: auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 18px;
}

.ob-bubble-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

/* Forced screens (_onboardingSeqRenderScreen(), js/onboarding.js) show this
   instead of a Next button — the sequence only advances once the real
   target itself is clicked. */
.ob-bubble-instruction {
  font-size: 12px;
  font-weight: 600;
  font-style: italic;
  color: var(--text-tertiary);
  margin: 0 0 12px;
}

.ob-bubble-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ob-bubble-skip {
  background: none;
  border: none;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-family: inherit;
  cursor: pointer;
}
.ob-bubble-skip:hover { color: var(--text-secondary); }

.ob-bubble-nav {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ob-bubble-back,
.ob-bubble-next {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.ob-bubble-back {
  background: var(--navy-light);
  color: var(--navy-dark);
}
.ob-bubble-back:hover { background: var(--border); }

.ob-bubble-next {
  background: var(--navy-dark);
  color: #fff;
}
.ob-bubble-next:hover { opacity: 0.9; }

@media (max-width: 768px) {
  #onboarding-bubble { width: 250px; padding: 12px 14px; }
}
