/* ===================================================== GUIDED TOURS
   Skin for driver.js (public/vendor/driver.css) plus the "Take a tour" picker.
   Loaded after public/vendor/driver.css so these rules win on equal specificity.

   Everything here is scoped to .bazic-tour (the popoverClass set in js/tour.js) or to
   the picker's own classes, so nothing leaks into the rest of the app. */

.bazic-tour.driver-popover {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px 14px;
  max-width: 360px;
  font-family: Inter, system-ui, sans-serif;
}

.bazic-tour .driver-popover-title {
  font-family: var(--font-sans), Inter, sans-serif;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.3;
}

.bazic-tour .driver-popover-description {
  font-size: var(--fs-xs);
  line-height: 1.62;
  color: var(--ink-2);
  margin-top: 7px;
}

.bazic-tour .driver-popover-description b {
  color: var(--ink);
  font-weight: 600;
}

.bazic-tour .driver-popover-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bazic-tour .driver-popover-progress-text {
  font-family: var(--font-mono), monospace;
  font-size: var(--fs-2xs);
  color: var(--muted);
  letter-spacing: .02em;
}

.bazic-tour .driver-popover-navigation-btns {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.bazic-tour .driver-popover-footer-btn {
  font-family: Inter, system-ui, sans-serif;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-1, var(--ink));
  cursor: pointer;
  text-shadow: none;
  transition: border-color .15s, background .15s;
}

.bazic-tour .driver-popover-footer-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* The forward button is the one people are meant to hit; the back button stays quiet. */
.bazic-tour .driver-popover-navigation-btns button:last-child {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--n-0);
}

.bazic-tour .driver-popover-navigation-btns button:last-child:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--n-0);
}

.bazic-tour .driver-popover-btn-disabled {
  opacity: .4;
  cursor: default;
}

.bazic-tour .driver-popover-close-btn {
  color: var(--muted);
  font-size: var(--fs-xl);
  width: 28px;
  height: 28px;
  line-height: 26px;
}

.bazic-tour .driver-popover-close-btn:hover {
  color: var(--ink);
  background: var(--panel-2);
  border-radius: var(--r-xs);
}

.bazic-tour .driver-popover-footer-btn:focus-visible,
.bazic-tour .driver-popover-close-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* driver.css hard-codes the arrow to var(--n-0). That happens to match --panel today, which
   is exactly the kind of coincidence that breaks silently the day the panel colour
   changes. Re-declared per side, because setting border-color on the base class would
   also repaint the three sides driver deliberately made transparent — turning the arrow
   into a solid square. */
.bazic-tour .driver-popover-arrow-side-left   { border-left-color:   var(--panel); }
.bazic-tour .driver-popover-arrow-side-right  { border-right-color:  var(--panel); }
.bazic-tour .driver-popover-arrow-side-top    { border-top-color:    var(--panel); }
.bazic-tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--panel); }

/* driver.js freezes this app without the next rule, so it is not cosmetic.
 *
 * driver.js assumes the page scrolls on the window, so when it highlights an element it
 * pins the element's scrollable parent with `overflow:hidden !important` to stop the
 * highlight sliding away. Here the ONLY scroll container is `.workspace-body .content`
 * (main.css:3248) and it is the parent of every card a step points at. Freezing it
 * collapsed the scroll position, which shifted the layout, which fired scroll and resize,
 * which sent driver back round to re-measure — against a DOM holding thousands of account
 * rows. The renderer stopped responding on the third step of the manager tour.
 *
 * Same specificity as driver.css and loaded after it, so this wins. The highlight is kept
 * aligned instead by refreshing driver on that container's own scroll — see the listener
 * in js/tour.js, which exists because scroll events from a nested element never reach the
 * window listener driver registers. */
.driver-active-element-parent-no-scroll {
  overflow: auto !important;
}

/* ---- the "Take a tour" picker ---------------------------------------------------- */

.tour-group + .tour-group {
  margin-top: 18px;
}

.tour-group-h {
  font-family: var(--font-mono), monospace;
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 7px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}

.tour-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 14px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}

.tour-pick:hover {
  border-color: var(--brand);
  background: var(--brand-bg);
}

.tour-pick:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.tour-pick-t {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink);
  grid-column: 1;
}

.tour-pick-b {
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--ink-2);
  grid-column: 1;
}

.tour-pick-go {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}
