/* ============================================================================
   Home Key — guided tour
   ----------------------------------------------------------------------------
   Loaded by the market page shells (/san-antonio/, /raleigh-durham/) AFTER
   app.css, so anything here wins a specificity tie against the bundle's
   Tailwind output. Nothing in this file targets an app selector; every rule is
   namespaced under .hk-tour* so the bundle cannot be restyled by accident.

   The tour deliberately does NOT dim or block the page. A modal scrim would
   make the walkthrough a thing you watch instead of a thing you do, and every
   step in this tour asks the reader to look at a real control they are meant
   to operate. The panel is a dock, not a dialog.

   Palette is lifted from the shells' own boot styles so the tour reads as part
   of the product rather than a bolted-on widget:
     #16294A  body navy      #1F3864  heading navy
     #B85042  rust accent    #8FA0BC  hairline
   ========================================================================== */

:root {
  --hk-navy: #16294A;
  --hk-navy-deep: #1F3864;
  --hk-rust: #B85042;
  --hk-rule: #8FA0BC;
  --hk-paper: #FFFFFF;
  --hk-wash: #F4F6FA;
  /* One z-index for the whole feature. The bundle's highest observed stacking
     context is well below this; sitting just under the 32-bit max leaves room
     for a browser extension to still paint above us. */
  --hk-z: 2147482000;
}

/* --------------------------------------------------------------------------
   Floating toggle — the guaranteed entry point.

   The nav-injected twin can be reconciled away by React at any render; this
   one lives outside #root and therefore cannot be. It is the fallback, so it
   must never depend on the app having mounted.
   -------------------------------------------------------------------------- */
.hk-tour-fab {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: var(--hk-z);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px 14px;
  font: 500 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--hk-paper);
  background: var(--hk-navy-deep);
  border: 1px solid var(--hk-navy-deep);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(22, 41, 74, .28);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.hk-tour-fab:hover { background: var(--hk-navy); }
.hk-tour-fab:focus-visible {
  outline: 3px solid var(--hk-rust);
  outline-offset: 2px;
}
.hk-tour-fab[aria-pressed="true"] {
  background: var(--hk-rust);
  border-color: var(--hk-rust);
}
.hk-tour-fab .hk-tour-fab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}

/* While the panel is open the FAB would sit on top of it on narrow screens.
   Hiding it is safe: the panel carries its own close control. */
.hk-tour-open .hk-tour-fab { display: none; }

/* --------------------------------------------------------------------------
   Panel
   -------------------------------------------------------------------------- */
.hk-tour-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--hk-z);
  width: min(384px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--hk-paper);
  color: var(--hk-navy);
  border: 1px solid var(--hk-rule);
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(22, 41, 74, .26);
  font: 14px/1.55 Georgia, "Times New Roman", serif;
  overflow: hidden;
}
.hk-tour-panel[hidden] { display: none; }

.hk-tour-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 10px;
  background: var(--hk-wash);
  border-bottom: 1px solid var(--hk-rule);
}
.hk-tour-eyebrow {
  flex: 1 1 auto;
  min-width: 0;
  font: 600 10.5px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--hk-navy-deep);
}
.hk-tour-eyebrow span { color: var(--hk-rust); }

.hk-tour-x {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin: -3px -3px 0 0;
  padding: 0;
  font: 400 17px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--hk-navy-deep);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}
.hk-tour-x:hover { color: var(--hk-rust); border-color: var(--hk-rule); }
.hk-tour-x:focus-visible { outline: 3px solid var(--hk-rust); outline-offset: 1px; }

.hk-tour-body {
  flex: 1 1 auto;
  padding: 13px 14px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.hk-tour-body h2 {
  margin: 0 0 8px;
  font: 600 16px/1.3 Georgia, "Times New Roman", serif;
  color: var(--hk-navy-deep);
}
.hk-tour-body p { margin: 0 0 9px; }
.hk-tour-body p:last-child { margin-bottom: 0; }
.hk-tour-body strong { color: var(--hk-navy-deep); }
/* Quoted app copy. Every quotation in the step text is verbatim from the
   rendered application — the marker makes that visible rather than asking the
   reader to take it on trust. */
.hk-tour-body q {
  quotes: "\201C" "\201D";
  font-style: italic;
  color: var(--hk-navy-deep);
}
.hk-tour-note {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  background: var(--hk-wash);
  border-left: 3px solid var(--hk-rust);
  border-radius: 0 4px 4px 0;
}

.hk-tour-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--hk-wash);
  border-top: 1px solid var(--hk-rule);
}
.hk-tour-count {
  flex: 1 1 auto;
  font: 400 11.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--hk-navy-deep);
  font-variant-numeric: tabular-nums;
}
.hk-tour-btn {
  flex: 0 0 auto;
  padding: 7px 13px;
  font: 500 12.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--hk-navy-deep);
  background: var(--hk-paper);
  border: 1px solid var(--hk-rule);
  border-radius: 6px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.hk-tour-btn:hover:not(:disabled) { border-color: var(--hk-navy-deep); }
.hk-tour-btn:focus-visible { outline: 3px solid var(--hk-rust); outline-offset: 1px; }
.hk-tour-btn:disabled { opacity: .42; cursor: default; }
.hk-tour-btn-primary {
  color: var(--hk-paper);
  background: var(--hk-navy-deep);
  border-color: var(--hk-navy-deep);
}
.hk-tour-btn-primary:hover:not(:disabled) { background: var(--hk-navy); border-color: var(--hk-navy); }

/* --------------------------------------------------------------------------
   Spotlight

   outline (not border) so the highlight adds no layout box and cannot reflow
   the app underneath it. box-shadow supplies the soft halo.
   -------------------------------------------------------------------------- */
.hk-tour-spot {
  outline: 2px solid var(--hk-rust) !important;
  outline-offset: 3px !important;
  border-radius: 3px;
  box-shadow: 0 0 0 6px rgba(184, 80, 66, .14) !important;
  scroll-margin-top: 96px;
  scroll-margin-bottom: 96px;
  animation: hk-tour-pulse 1.5s ease-out 2;
}
@keyframes hk-tour-pulse {
  0%   { box-shadow: 0 0 0 2px rgba(184, 80, 66, .42) !important; }
  100% { box-shadow: 0 0 0 12px rgba(184, 80, 66, 0) !important; }
}

/* When a step has no anchor to point at — which happens if the app changes
   under us — the panel says so rather than silently pointing nowhere. */
.hk-tour-missing {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--hk-navy-deep);
  background: #FBF0EE;
  border: 1px solid var(--hk-rust);
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Narrow screens: the panel becomes a bottom sheet spanning the width. The
   driver reads this same breakpoint to decide where to park a highlighted
   element, so the two must stay in sync.
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .hk-tour-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-height: 58vh;
    border-radius: 10px 10px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .hk-tour-fab { left: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hk-tour-spot { animation: none; }
  .hk-tour-panel { box-shadow: 0 4px 18px rgba(22, 41, 74, .26); }
}

/* Forced-colors (Windows high contrast): system colours replace ours, so
   restore the affordances that depend on colour alone. */
@media (forced-colors: active) {
  .hk-tour-panel { border: 1px solid CanvasText; }
  .hk-tour-spot { outline: 3px solid Highlight !important; }
}

/* The tour is screen furniture. It has no place in a printed pro forma. */
@media print {
  .hk-tour-panel, .hk-tour-fab { display: none !important; }
  .hk-tour-spot { outline: none !important; box-shadow: none !important; }
}
