/* QVegas Directory — /directory/
   Search-first finder over /api/directory. Desktop: list + sticky map split.
   Phone: intent rail scrolls sideways, filters wrap, the map is a full-screen sheet. */

.dx {
  --dx-gap: 16px;
  --dx-champagne: #e6d3a3;
  --dx-ivory: #f4efe6;
  --dx-hair: linear-gradient(90deg, #ff3366, #ff6633, #ffcc00, #33cc99, #3366ff, #9933ff);
  --dx-sticky-top: 64px;
  /* StratusUI tokens, mapped onto the site palette. */
  --sui-font: var(--font-body);
  --sui-font-display: var(--font-display);
  --sui-surface: var(--dark-card);
  --sui-surface-2: var(--dark-surface);
  --sui-border: var(--dark-border);
  --sui-fg: var(--white);
  --sui-text: var(--light);
  --sui-text-dim: var(--light-muted);
  --sui-text-faint: var(--dark-muted);
  --sui-accent: var(--neon-pink);
  --sui-accent-contrast: #fff;
  --sui-accent-soft: rgba(255, 20, 147, 0.22);
  --sui-accent-2: var(--neon-blue);
  --sui-radius: 14px;
  --sui-radius-sm: 10px;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.dx-hero { position: relative; padding: calc(64px + clamp(40px, 7vw, 88px)) 0 clamp(28px, 4vw, 44px); overflow: hidden; }
.dx-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 70% at 15% 0%, rgba(255, 20, 147, 0.13), transparent 70%),
              radial-gradient(ellipse 50% 60% at 90% 10%, rgba(0, 212, 255, 0.10), transparent 70%); }
.dx-hero .wrap { position: relative; }
.dx-eyebrow { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dx-champagne); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.dx-eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--dx-hair); border-radius: 2px; }
.dx-hero h1 { font-family: var(--font-display); font-size: clamp(2.4rem, 6.4vw, 4.6rem); line-height: 1.02; color: var(--white); margin: 0 0 14px; letter-spacing: -0.01em; }
.dx-hero h1 em { font-style: italic; background: var(--vegas-glow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dx-lede { color: var(--light); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 640px; margin: 0 0 26px; line-height: 1.55; }

.dx-search { position: relative; max-width: 720px; }
.dx-search svg.dx-search-ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: var(--light-muted); pointer-events: none; }
.dx-search .sui-input { width: 100%; box-sizing: border-box; font-size: 1.05rem; padding: 17px 52px 17px 50px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--dark-border); color: var(--white); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.dx-search .sui-input:focus { border-color: var(--neon-pink); outline: none; box-shadow: 0 0 0 4px rgba(255, 20, 147, 0.16), 0 10px 40px rgba(0, 0, 0, 0.35); }
.dx-search .dx-clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0; border-radius: 999px; display: none; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1; }
.dx-search.has-q .dx-clear { display: inline-flex; }

.dx-try { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.dx-try-label { color: var(--light-muted); font-size: 0.8rem; margin-right: 2px; }
.dx-try .sui-chip { cursor: pointer; background: transparent; color: var(--light); transition: border-color .15s, color .15s; }
.dx-try .sui-chip:hover { border-color: var(--neon-blue); color: var(--white); }

.dx-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 22px; color: var(--light-muted); font-size: 0.85rem; }
.dx-stats b { color: var(--white); font-family: var(--font-mono); font-weight: 600; margin-right: 4px; }
.dx-lede a { color: var(--neon-blue, #4fc3f7); }
/* /resources: the crisis lines, always above the fold. */
.dx-crisis { margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(255, 20, 147, 0.35); background: rgba(255, 20, 147, 0.08); color: var(--light); font-size: 0.9rem; line-height: 1.6; overflow-wrap: anywhere; }
.dx-crisis strong { color: var(--white); margin-right: 4px; }
.dx-crisis a { color: var(--white); font-weight: 700; white-space: nowrap; }

/* ── Intent rail ──────────────────────────────────────────────────── */
.dx-intents { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin: 6px 0 22px; }
.dx-intent { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 14px 12px; border-radius: 14px; border: 1px solid var(--dark-border); background: var(--dark-card); color: var(--light); cursor: pointer; font: inherit; text-align: left; transition: border-color .15s, background .15s, transform .15s; min-width: 0; }
.dx-intent:hover { border-color: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.dx-intent svg { width: 22px; height: 22px; fill: var(--dx-champagne); }
.dx-intent .dx-intent-label { font-weight: 600; font-size: 0.86rem; color: var(--white); line-height: 1.2; }
.dx-intent .dx-intent-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--light-muted); }
.dx-intent.is-on { border-color: var(--neon-pink); background: linear-gradient(160deg, rgba(255, 20, 147, 0.16), rgba(191, 95, 255, 0.08)); }
.dx-intent.is-on svg { fill: var(--neon-pink); }

/* ── Sticky toolbar ───────────────────────────────────────────────── */
.dx-bar { position: sticky; top: var(--dx-sticky-top); z-index: 50; background: rgba(10, 10, 15, 0.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--dark-border); margin: 0 0 22px; }
.dx-bar-inner { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.dx-count { color: var(--white); font-weight: 600; font-size: 0.95rem; margin-right: auto; min-width: 0; }
.dx-count small { color: var(--light-muted); font-weight: 400; margin-left: 6px; }
.dx-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--light); font-size: 0.85rem; cursor: pointer; user-select: none; white-space: nowrap; }
.dx-sort { min-width: 160px; }
.dx-sort .sui-sel-wrap, .dx-sort .sui-sel-trigger { width: 100%; }
.dx-sort select, .dx-sort .sui-sel-trigger { font-size: 0.85rem; }
.dx-mapbtn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dx-mapbtn svg { width: 15px; height: 15px; fill: currentColor; }
.dx-mapbtn.is-on { border-color: var(--neon-blue); color: var(--neon-blue); }

/* ── Body: list (+ map on desktop) ────────────────────────────────── */
.dx-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.dx-body.with-map { grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr); }
.dx-mapwrap { display: none; }
.dx-body.with-map .dx-mapwrap { display: block; position: sticky; top: calc(var(--dx-sticky-top) + 78px); height: calc(100vh - var(--dx-sticky-top) - 100px); border-radius: 18px; overflow: hidden; border: 1px solid var(--dark-border); background: var(--dark-surface); }
#dx-map { width: 100%; height: 100%; }
.dx-map-close { display: none; }

.dx-section { margin: 0 0 40px; }
.dx-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.dx-section-head h2 { font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.7rem); color: var(--white); margin: 0; }
.dx-section-head p { color: var(--light-muted); font-size: 0.85rem; margin: 4px 0 0; }
.dx-section-head .sui-btn { white-space: nowrap; }

.dx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--dx-gap); }
.dx-body.with-map .dx-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.dx-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: var(--dx-gap); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.dx-rail > * { scroll-snap-align: start; }

/* ── Card ─────────────────────────────────────────────────────────── */
.dx-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--dark-card); border: 1px solid var(--dark-border); transition: border-color .15s, transform .15s, box-shadow .15s; min-width: 0; }
.dx-card:hover, .dx-card.is-hot { border-color: rgba(255, 255, 255, 0.24); transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4); }
.dx-card.is-hot { border-color: var(--neon-blue); }
.dx-card-top { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.dx-logo { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; overflow: hidden; background: #fff; display: flex; align-items: center; justify-content: center; }
.dx-logo img { width: 100%; height: 100%; object-fit: contain; }
.dx-mono { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: #fff; letter-spacing: 0.02em; }
.dx-card-id { min-width: 0; flex: 1; }
.dx-name { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; color: var(--white); line-height: 1.25; margin: 0 0 4px; overflow-wrap: anywhere; }
.dx-name a { color: inherit; text-decoration: none; }
.dx-name a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.dx-name a:focus-visible { outline: none; }
.dx-card:focus-within { border-color: var(--neon-pink); }
.dx-meta { color: var(--light-muted); font-size: 0.8rem; line-height: 1.4; }
.dx-meta .dx-dist { color: var(--neon-blue); font-family: var(--font-mono); margin-left: 6px; }
.dx-note { color: var(--light); font-size: 0.86rem; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dx-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--dark-border); color: var(--light); white-space: nowrap; }
.dx-tag svg { width: 11px; height: 11px; fill: currentColor; }
.dx-tag-owned { border: 1px solid transparent; background: linear-gradient(var(--dark-card), var(--dark-card)) padding-box, var(--dx-hair) border-box; color: var(--white); }
.dx-tag-verified { color: var(--green); border-color: rgba(51, 204, 153, 0.35); }
.dx-tag-pick { color: var(--dx-champagne); border-color: rgba(230, 211, 163, 0.4); }
.dx-tag-closed { color: #ff8a8a; border-color: rgba(255, 90, 90, 0.4); }
.dx-card.is-closed { opacity: .62; }
.dx-card.is-closed .dx-logo, .dx-card.is-closed img { filter: grayscale(1); }
.dx-tag-lambda { color: var(--neon-purple); border-color: rgba(191, 95, 255, 0.35); }
.dx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; position: relative; z-index: 2; }
.dx-actions a { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--light); text-decoration: none; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--dark-border); background: rgba(255, 255, 255, 0.02); }
.dx-actions a:hover { color: var(--white); border-color: rgba(255, 255, 255, 0.3); }
.dx-actions svg { width: 13px; height: 13px; fill: currentColor; }

/* ── Empty / loading ─────────────────────────────────────────────── */
.dx-empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--dark-border); border-radius: 18px; color: var(--light); }
.dx-empty h3 { font-family: var(--font-display); color: var(--white); font-size: 1.4rem; margin: 0 0 8px; }
.dx-empty p { color: var(--light-muted); margin: 0 auto 18px; max-width: 460px; }
.dx-empty .sui-btn + .sui-btn { margin-left: 8px; }
.dx-skel { height: 168px; border-radius: 16px; }

/* ── Bottom band ─────────────────────────────────────────────────── */
.dx-band { margin: 24px 0 64px; padding: clamp(24px, 4vw, 40px); border-radius: 22px; border: 1px solid var(--dark-border); background: radial-gradient(ellipse 70% 120% at 0% 0%, rgba(255, 20, 147, 0.12), transparent 60%), var(--dark-card); }
.dx-band h2 { font-family: var(--font-display); color: var(--white); font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 6px; }
.dx-band p { color: var(--light); margin: 0; max-width: 560px; line-height: 1.55; }
.dx-band-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dx-band .sui-btn-primary { background: var(--dx-ivory); color: #121218; }
.dx-band .sui-btn { padding: 11px 18px; text-decoration: none; display: inline-block; }

/* ── Map pins ────────────────────────────────────────────────────── */
.dx-pin { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #fff; border: 2px solid var(--neon-blue); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s; }
.dx-pin.owned { border-color: var(--neon-pink); }
.dx-pin.is-hot { transform: scale(1.3); z-index: 10; }
.dx-pin img { width: 100%; height: 100%; object-fit: contain; }
.dx-pin .dx-mono { font-size: 0.8rem; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dx-intents { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dx-body.with-map { grid-template-columns: minmax(0, 1fr); }
  /* On tablets and phones the map is a full-screen sheet over the list. */
  .dx-body.with-map .dx-mapwrap { position: fixed; inset: 0; top: 0; height: auto; z-index: 2500; border-radius: 0; border: 0; }
  .dx-body.with-map .dx-map-close { display: inline-flex; position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 5; align-items: center; gap: 6px; box-shadow: 0 6px 20px rgba(0,0,0,0.45); }
  .dx-peek { position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5; }
}
@media (max-width: 780px) {
  .dx-intents { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 0 4px; scrollbar-width: none; }
  .dx-intents::-webkit-scrollbar { display: none; }
  .dx-intent { flex: 0 0 auto; width: 112px; scroll-snap-align: start; padding: 12px; }
  .dx-bar-inner { gap: 10px 12px; }
  .dx-count { flex: 1 0 100%; }
  .dx-sort { min-width: 0; flex: 1 1 140px; }
  .dx-grid, .dx-body.with-map .dx-grid { grid-template-columns: minmax(0, 1fr); }
  .dx-rail { grid-auto-columns: 86%; }
  .dx-search .sui-input { font-size: 16px; }
  .dx-hero { padding-top: calc(64px + 32px); }
}
@media (max-width: 400px) {
  .dx-toggle { font-size: 0.8rem; }
}
.dx-peek:empty { display: none; }
.dx-peek .dx-card { box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55); }
@media (min-width: 901px) { .dx-peek { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .dx-card, .dx-intent, .dx-pin { transition: none; }
  .dx-card:hover, .dx-intent:hover { transform: none; }
}
.dx-notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(0, 212, 255, 0.35); background: rgba(0, 212, 255, 0.08); color: var(--white); font-size: 0.88rem; }

/* ── List your business: Apple Business Connect steps ───────────── */
.dx-band p { max-width: 720px; }
.dx-steps { list-style: none; counter-reset: dx-step; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.dx-steps li { counter-increment: dx-step; position: relative; padding: 16px 16px 16px 54px; border-radius: 14px; border: 1px solid var(--dark-border); background: rgba(255, 255, 255, 0.02); color: var(--light); font-size: 0.88rem; line-height: 1.55; }
.dx-steps li::before { content: counter(dx-step); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 600; font-size: 0.85rem; color: #121218; background: var(--dx-champagne); }
.dx-steps strong { color: var(--white); display: block; margin-bottom: 2px; }
.dx-steps a { color: var(--neon-blue); }

/* ── Apple Maps fallback in search ──────────────────────────────── */
.dx-apple { margin: 28px 0 8px; }
.dx-apple-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.dx-apple-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px dashed rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.02); color: var(--light); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; min-width: 0; width: 100%; white-space: normal; overflow: hidden; }
.dx-apple-item:hover, .dx-apple-item:focus-visible { border-color: var(--neon-blue); background: rgba(0, 212, 255, 0.06); outline: none; }
.dx-apple-item[disabled] { opacity: 0.6; cursor: progress; }
.dx-apple-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(0, 212, 255, 0.12); }
.dx-apple-ic svg { width: 18px; height: 18px; fill: var(--neon-blue); }
.dx-apple-txt { display: block; min-width: 0; flex: 1 1 auto; }
.dx-apple-name { display: block; color: var(--white); font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.dx-apple-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--light-muted); font-size: 0.8rem; line-height: 1.35; overflow-wrap: anywhere; margin-top: 2px; }
.dx-apple-add { flex: 0 0 auto; font-size: 0.75rem; font-weight: 700; color: var(--neon-blue); white-space: nowrap; }
.dx-apple-note { color: var(--light-muted); font-size: 0.8rem; margin: 10px 0 0; }
.dx-apple-note a { color: var(--neon-blue); }
@media (max-width: 780px) { .dx-apple-list { grid-template-columns: minmax(0, 1fr); } }
.dx-band p + p { margin-top: 14px; }
