/* =====================================================================
 * AGORA — universal shell design system
 *
 * One stylesheet drives every vertical's surface. Brand-specific values
 * (accent, background, text, …) come from the vertical's shell.brand
 * block and are written to CSS custom properties at boot.
 *
 * Naming follows the --pb-* convention established by the PageBuilder so
 * tenant-published pages and the global shell share the same visual
 * substrate. A handful of shell-only --sh-* tokens cover layout-only
 * concerns (vignette glow, marker pulse) that don't apply to PB pages.
 * ===================================================================== */

:root {
  /* Brand tokens — runtime-overridden via agora.js#applyTheme(). The
     defaults match the motor (motoryx) palette so the shell never paints
     un-themed if the manifest fetch fails. */
  --pb-bg:      #0a0e1a;
  --pb-surface: #111827;
  --pb-text:    #e8edf7;
  --pb-muted:   #7b8aaa;
  --pb-accent:  #f97316;

  /* Derived tokens — kept in sync by applyTheme() so accent-tinted glows
     and borders feel right against any brand. */
  --sh-accent-glow:    rgba(249, 115, 22, 0.5);
  --sh-accent-soft:    rgba(249, 115, 22, 0.18);
  --sh-accent-rim:     rgba(249, 115, 22, 0.30);
  --sh-border:         rgba(255, 255, 255, 0.08);
  --sh-card:           rgba(17, 24, 39, 0.78);
  --sh-shadow-deep:    0 24px 80px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--pb-bg);
  color: var(--pb-text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
body.shell { overflow: hidden; }     /* full-bleed map mode */
body.picker {
  overflow: auto; min-height: 100vh;
  /* Multi-radial mesh — three soft tints from sacred (purple/pink) +
     monetized (orange/lime) + sky (cyan) to hint at the diversity of
     worlds without belonging to any single one. Fixed-attachment so the
     gradient doesn't scroll with content. */
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%,  rgba(249,115,22,0.18), transparent 70%),
    radial-gradient(ellipse 70% 50% at 90% 100%, rgba(132,204,22,0.12), transparent 70%),
    radial-gradient(ellipse 70% 50% at  5% 90%,  rgba(139,92,246,0.13), transparent 70%),
    radial-gradient(ellipse 50% 30% at 50% 50%,  rgba(6,182,212,0.05), transparent 70%),
    var(--pb-bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* =====================================================================
 * Stage — the map IS the canvas. When a vertical has no map (e.g. byte
 * compute marketplace prefers a list), js can hide #map and switch the
 * body class to hide vignettes.
 * ===================================================================== */
#map { position: fixed; inset: 0; z-index: 0; height: 100%; }
/* No canvas filter — the map was too dark when stacked with #vignette
   and the building-tint in agora.js. Filter back in only if a specific
   vertical wants a moody look (TODO: surface via shell.stage.filter). */

#vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  /* Subtle bottom-only fade so the cards rail reads cleanly against the
     map. Top gradient + side darkening removed — they were doing too
     much when combined with the (now-removed) canvas filter. */
  background:
    linear-gradient(to top, color-mix(in srgb, var(--pb-bg) 55%, transparent) 0%, transparent 22%);
}
#spotlight {
  position: fixed; left: 50%; bottom: -15vh; transform: translateX(-50%);
  width: 80vw; height: 50vh; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, var(--sh-accent-glow) 0%, transparent 60%);
  opacity: 0.25; filter: blur(40px);
}

/* =====================================================================
 * Header — brand corner. Pointer-disabled so the map underneath stays
 * draggable through the headline.
 * ===================================================================== */
.sh-header {
  position: fixed; top: 1.5rem; left: 1.75rem; z-index: 30;
  display: flex; flex-direction: column; gap: 0.15rem; pointer-events: none;
}
.sh-header .brand {
  font: 700 1.6rem/1 ui-sans-serif, "Inter Tight", system-ui;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 24px rgba(0,0,0,0.9), 0 0 60px rgba(0,0,0,0.6);
  color: var(--pb-text);
}
.sh-header .tagline {
  color: var(--pb-muted);
  font-size: 0.85rem; font-weight: 400; letter-spacing: 0.04em;
  text-shadow: 0 1px 12px rgba(0,0,0,0.9);
}
.sh-header .home-link {
  pointer-events: auto;
  display: inline-block; margin-top: 0.3rem;
  font-size: 0.72rem; color: var(--pb-muted); opacity: 0.8;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.sh-header .home-link:hover { color: var(--pb-accent); opacity: 1; }

/* =====================================================================
 * Mode switcher — pill nav, top-right. Items come from shell.nav.
 * ===================================================================== */
.sh-mode {
  position: fixed; top: 1.25rem; right: 1.25rem; z-index: 30;
  display: flex; gap: 0.25rem; padding: 0.25rem;
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid var(--sh-border); border-radius: 999px;
  box-shadow: var(--sh-shadow-deep);
}
.sh-mode button {
  border: 0; background: transparent; color: var(--pb-muted);
  padding: 0.5rem 0.95rem; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.4rem;
  transition: color 0.2s, background 0.2s;
}
.sh-mode button:hover { color: var(--pb-text); }
.sh-mode button.active { background: var(--pb-accent); color: var(--pb-bg); }
.sh-mode button.signed-in { color: var(--pb-accent); font-weight: 600; }
.sh-mode button.signed-in.active { color: var(--pb-bg); }
.sh-mode button .icon { opacity: 0.7; }
.sh-mode button.active .icon { opacity: 1; }
@media (max-width: 640px) {
  .sh-mode button .label { display: none; }
  .sh-mode button { padding: 0.5rem 0.65rem; }
}

/* =====================================================================
 * Cards strip — vertical-side column. Hidden under 900px so the prompt
 * + map have full width on phones.
 * ===================================================================== */
.sh-cards {
  position: fixed; top: 5rem; right: 1.25rem; bottom: 14rem;
  width: 340px; z-index: 20;
  overflow-y: auto; padding-right: 0.25rem; pointer-events: none;
  scrollbar-width: thin; scrollbar-color: var(--sh-border) transparent;
}
.sh-cards::-webkit-scrollbar { width: 4px; }
.sh-cards::-webkit-scrollbar-thumb { background: var(--sh-border); border-radius: 2px; }
.sh-cards .card {
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--sh-border); border-radius: 14px;
  padding: 0.95rem 1.1rem; margin-bottom: 0.6rem;
  pointer-events: auto; cursor: pointer;
  transform: translateX(0); opacity: 0;
  animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.sh-cards .card:hover {
  transform: translateX(-6px);
  border-color: var(--pb-accent);
  background: color-mix(in srgb, var(--pb-surface) 92%, transparent);
}
.sh-cards .card.is-demo {
  position: relative;
  border-style: dashed;
  opacity: 0.92;
}
.sh-cards .card .demo-tag {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 180, 60, 0.18);
  color: rgba(255, 180, 60, 0.95);
  border: 1px solid rgba(255, 180, 60, 0.4);
  text-transform: uppercase;
  pointer-events: none;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.sh-cards .card .title { font-weight: 600; font-size: 0.95rem; }
.sh-cards .card .meta  { color: var(--pb-muted); font-size: 0.8rem; margin-top: 0.3rem; }
.sh-cards .card .text  { color: var(--pb-text); font-size: 0.85rem; margin-top: 0.4rem; opacity: 0.85; }
.sh-cards .card .price {
  color: var(--pb-accent); font-weight: 700; margin-top: 0.55rem; font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.sh-cards .card .badges {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; align-items: center;
}
.sh-cards .card .badges-label {
  color: var(--pb-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.sh-cards .card .badge {
  background: var(--sh-accent-soft); color: var(--pb-accent);
  border: 1px solid var(--sh-accent-rim);
  padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 500;
}
.sh-cards .card .urgency {
  display: inline-block; font-size: 0.78rem; font-weight: 600;
  padding: 0.2rem 0.65rem; border-radius: 6px; margin-top: 0.5rem;
}
.sh-cards .u-akut     { color: #fca5a5; background: rgba(248,113,113,0.18); animation: pulseSoft 2s ease-in-out infinite; }
.sh-cards .u-dringend { color: #fdba74; background: rgba(251,146,60,0.18); }
.sh-cards .u-bald     { color: #fde68a; background: rgba(251,191,36,0.14); }
@keyframes pulseSoft { 0%,100%{opacity:1} 50%{opacity:.6} }
.sh-cards.empty { display: none; }
@media (max-width: 900px) { .sh-cards { display: none; } }

/* =====================================================================
 * Prompt — the gravitational center. Floating, centered, the brand-glow
 * underneath telegraphs "this is where conversation happens".
 * ===================================================================== */
.sh-prompt-wrap {
  position: fixed; left: 50%; bottom: 1.75rem;
  transform: translateX(-50%); z-index: 25;
  width: min(720px, 92vw);
}
.sh-prompt-form {
  display: flex; gap: 0.5rem; align-items: center;
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  border: 1px solid var(--sh-border); border-radius: 18px;
  padding: 0.65rem 0.65rem 0.65rem 1.25rem;
  box-shadow:
    var(--sh-shadow-deep),
    0 0 0 1px var(--sh-border) inset,
    0 0 80px var(--sh-accent-glow);
  transition: box-shadow 0.3s;
}
.sh-prompt-form:focus-within {
  box-shadow:
    var(--sh-shadow-deep),
    0 0 0 2px var(--pb-accent) inset,
    0 0 100px var(--sh-accent-glow);
}
.sh-prompt-input {
  flex: 1; padding: 0.7rem 0;
  border: 0; background: transparent; color: var(--pb-text);
  font: inherit; font-size: 1rem; outline: none;
}
.sh-prompt-input::placeholder { color: var(--pb-muted); }
.sh-voice-btn, .sh-send-btn {
  border: 0; border-radius: 12px; padding: 0.7rem 0.95rem;
  font-size: 1.05rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.2s, color 0.2s;
}
.sh-voice-btn { background: transparent; color: var(--pb-muted); }
.sh-voice-btn:hover { color: var(--pb-text); }
.sh-voice-btn.recording {
  background: #ef4444; color: white;
  animation: pulse 1.2s ease-in-out infinite;
}
.sh-send-btn { background: var(--pb-accent); color: var(--pb-bg); min-width: 3rem; }
.sh-send-btn:hover { transform: scale(1.05); }
.sh-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50%      { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

.sh-reply {
  margin: 0.7rem auto 0; padding: 0.65rem 1.1rem;
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--sh-border); border-radius: 12px;
  color: var(--pb-text); font-size: 0.9rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.4s, transform 0.4s;
}
.sh-reply.show { opacity: 1; transform: translateY(0); }

.sh-examples {
  display: flex; gap: 0.4rem; margin-top: 0.7rem; flex-wrap: wrap; justify-content: center;
}
.sh-examples button {
  padding: 0.4rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--sh-border); background: var(--sh-card);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--pb-muted); font: inherit; font-size: 0.78rem;
  transition: all 0.15s;
}
.sh-examples button:hover { color: var(--pb-text); border-color: var(--pb-accent); }

/* =====================================================================
 * Facets — universal filter-chip panel above the prompt.
 *
 * Collapsed default: a single "Filter ▾" pill above the prompt-form.
 * Expanded: a translucent panel with one row per facet (chips OR a
 * min/max numeric pair), plus a live "X gefunden" count and reset link.
 *
 * Brand-aware: pills inherit the vertical's accent via --pb-accent, so
 * motor pills glow orange, barter green, help amber, etc. without any
 * per-vertical CSS.
 *
 * Layout: fixed, anchored just above the prompt-wrap. Mobile collapses
 * to full-width.
 * ===================================================================== */
.sh-facets {
  /* Sit ABOVE the prompt-wrap stack (form + reply + examples ~6-7rem tall
     including padding). z-index above .sh-prompt-wrap (25) so the toggle
     pill isn't covered by the prompt's blur-glow. */
  position: fixed; left: 50%; bottom: calc(1.75rem + 9rem);
  transform: translateX(-50%); z-index: 26;
  width: min(720px, 92vw);
  display: flex; flex-direction: column; align-items: stretch; gap: 0.55rem;
  pointer-events: none;     /* let map drag through gaps */
}
.sh-facets > * { pointer-events: auto; }
/* Body grows upward; cap at 60vh + scroll so it doesn't push the toggle off-screen. */
.sh-facets-body { max-height: 60vh; overflow-y: auto; }

.sh-facets-toggle {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--sh-border); border-radius: 999px;
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: var(--pb-muted); font: inherit; font-size: 0.8rem; font-weight: 500;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sh-facets-toggle:hover { color: var(--pb-text); border-color: var(--pb-accent); }
.sh-facets.open .sh-facets-toggle {
  color: var(--pb-text); border-color: var(--pb-accent);
  background: var(--sh-accent-soft);
}
.sh-facets-toggle-count {
  color: var(--pb-accent); font-weight: 600; font-size: 0.78rem;
}
.sh-facets-toggle-caret { transition: transform 0.2s ease; font-size: 0.7rem; opacity: 0.7; }
.sh-facets.open .sh-facets-toggle-caret { transform: rotate(180deg); opacity: 1; }

.sh-facets-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  opacity: 0;
  padding: 0 1.1rem;
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid var(--sh-border); border-radius: 16px;
  box-shadow: var(--sh-shadow-deep);
}
.sh-facets.open .sh-facets-body {
  max-height: 60vh;       /* generous; mobile keyboard still fits */
  opacity: 1;
  padding: 0.95rem 1.1rem;
  overflow-y: auto;
}
.sh-facets-body[hidden] { display: none; }

.sh-facets-rows {
  display: flex; flex-direction: column; gap: 0.85rem;
}
.sh-facets-row {
  display: flex; flex-direction: column; gap: 0.45rem;
}
.sh-facets-row[hidden] { display: none; }
.sh-facets-row-label {
  color: var(--pb-muted); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 500;
}
.sh-facets-chips {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.sh-chip {
  padding: 0.32rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--sh-border); background: rgba(255,255,255,0.03);
  color: var(--pb-text); font: inherit; font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.sh-chip:hover { border-color: var(--pb-accent); color: var(--pb-accent); }
.sh-chip.selected {
  background: var(--pb-accent); color: var(--pb-bg);
  border-color: var(--pb-accent); font-weight: 600;
}
.sh-chip.selected::before {
  content: '✓'; margin-right: 0.3rem; font-size: 0.78rem; opacity: 0.95;
}
.sh-chip.highlight {
  /* Manifest declared this chip as a "feature" value — bigger, accent-tinted
     bg even when unselected so the eye lands on it. Common use: drive=electric
     in motor (the EV-first push). */
  background: var(--sh-accent-soft);
  border-color: var(--sh-accent-rim);
  font-size: 0.86rem; padding: 0.4rem 1rem;
}
.sh-chip.highlight.selected {
  background: var(--pb-accent); color: var(--pb-bg);
}

.sh-range-input {
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.sh-range-input input {
  width: 8rem; padding: 0.4rem 0.7rem;
  border: 1px solid var(--sh-border); border-radius: 10px;
  background: rgba(255,255,255,0.04); color: var(--pb-text);
  font: inherit; font-size: 0.85rem; outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.sh-range-input input:focus { border-color: var(--pb-accent); background: rgba(255,255,255,0.06); }
.sh-range-input input::placeholder { color: var(--pb-muted); }
.sh-range-sep { color: var(--pb-muted); font-size: 0.85rem; }

/* Autocomplete / typeahead facet — single input + clear button + dropdown.
 * The .sh-facet-control wrapper is position:relative so the absolutely-
 * positioned suggestion list anchors under the input regardless of how
 * much vertical space the row takes. */
.sh-facets-row .sh-facet-control {
  position: relative;
  display: flex; align-items: center; gap: 0.4rem;
  width: 100%; max-width: 22rem;
}
.sh-facet-typeahead {
  flex: 1 1 auto; min-width: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--sh-border); border-radius: 10px;
  background: rgba(255,255,255,0.04); color: var(--pb-text);
  font: inherit; font-size: 0.85rem; outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.sh-facet-typeahead:focus { border-color: var(--pb-accent); background: rgba(255,255,255,0.06); }
.sh-facet-typeahead::placeholder { color: var(--pb-muted); }
.sh-facet-clear {
  flex: 0 0 auto;
  width: 1.6rem; height: 1.6rem; padding: 0;
  border: 1px solid var(--sh-border); border-radius: 999px;
  background: rgba(255,255,255,0.04); color: var(--pb-muted);
  font: inherit; font-size: 0.72rem; line-height: 1; cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sh-facet-clear:hover { color: var(--pb-accent); border-color: var(--pb-accent); }
.sh-facet-clear[hidden] { display: none; }
.sh-facet-suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.25rem);
  z-index: 30;
  max-height: 280px; overflow-y: auto;
  margin: 0; padding: 0.25rem 0; list-style: none;
  background: var(--pb-surface);
  border: 1px solid var(--sh-border); border-radius: 10px;
  box-shadow: var(--sh-shadow-deep);
}
.sh-facet-suggestions[hidden] { display: none; }
.sh-facet-suggestions li {
  padding: 0.35rem 0.7rem;
  color: var(--pb-text); font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.sh-facet-suggestions li:hover {
  background: var(--sh-accent-soft); color: var(--pb-accent);
}
.sh-facet-suggestions li[aria-selected="true"] {
  background: var(--sh-accent-soft); color: var(--pb-accent);
  font-weight: 600;
}

.sh-facets-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-top: 0.9rem; padding-top: 0.7rem;
  border-top: 1px solid var(--sh-border);
}
.sh-facets-count {
  color: var(--pb-muted); font-size: 0.82rem; font-weight: 500;
}
.sh-facets-reset {
  color: var(--pb-muted); font-size: 0.78rem;
  border-bottom: 1px dotted var(--pb-muted);
  transition: color 0.15s, border-color 0.15s;
}
.sh-facets-reset:hover { color: var(--pb-accent); border-bottom-color: var(--pb-accent); }
.sh-facets-reset[hidden] { display: none; }

@media (max-width: 640px) {
  .sh-facets { width: 96vw; }
  .sh-range-input input { width: 6.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sh-facets-body { transition: none; }
  .sh-facets-toggle-caret { transition: none; }
}

/* =====================================================================
 * Reply-banner — wave-11 chat-pinned-filters feedback.
 *
 * When the chat capability returns a filter_state_delta, we mutate the
 * facet panel programmatically. To make that change discoverable, a small
 * accent-tinted banner appears above the prompt-form for ~4s with text
 * like "Diesel + Kombi gesetzt" so the user notices their chips moved.
 *
 * Layout: sits inside the .sh-prompt-wrap stack, just above the form,
 * so it lines up with the same column as .sh-reply / .sh-examples.
 * ===================================================================== */
.sh-reply-banner {
  margin: 0 auto 0.55rem; padding: 0.55rem 0.95rem;
  background: var(--sh-accent-soft, rgba(249, 115, 22, 0.18));
  border: 1px solid var(--sh-accent-rim, rgba(249, 115, 22, 0.30));
  border-radius: 999px;
  color: var(--pb-text);
  font-size: 0.82rem; font-weight: 500;
  text-align: center;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.32s ease, transform 0.32s ease;
  max-width: min(540px, 88vw);
  box-shadow: 0 4px 18px var(--sh-accent-glow, rgba(249, 115, 22, 0.20));
}
.sh-reply-banner.show { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .sh-reply-banner { transition: opacity 0.1s linear; transform: none; }
}

/* Autocomplete requires-hint — shown when a typeahead has unfulfilled
   `requires:` deps (e.g. Modell before Marke is picked). Muted style:
   present but not loud, since the user just hasn't done step 1 yet. */
.sh-facet-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem; color: var(--pb-muted);
  font-style: italic; padding-left: 0.4rem;
  border-left: 2px solid var(--sh-accent-rim, rgba(255,255,255,0.12));
}

/* Cross-world chips — surface after a create or alongside a search. */
.sh-crosslinks {
  margin-top: 0.7rem; padding: 0.7rem 1rem;
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--sh-border); border-radius: 12px;
}
.sh-crosslinks .cw-label {
  color: var(--pb-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.sh-crosslinks .cw-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0.25rem 0.15rem 0;
  padding: 0.35rem 0.7rem; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--sh-border);
  font-size: 0.78rem; color: var(--pb-text); text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.sh-crosslinks .cw-chip:hover { background: rgba(255,255,255,0.08); border-color: var(--pb-accent); }
.sh-crosslinks .cw-chip b { font-weight: 700; color: var(--pb-accent); }
.sh-crosslinks .cw-chip span { color: var(--pb-muted); }
.sh-crosslinks .cw-chip small { color: var(--pb-muted); opacity: 0.7; }

/* =====================================================================
 * Modal — hybrid auth fallback (magic-link).
 * ===================================================================== */
.sh-modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--pb-bg) 85%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sh-modal.show { display: flex; }
.sh-modal .panel {
  background: var(--pb-surface); border: 1px solid var(--sh-border);
  border-radius: 18px; padding: 2rem; width: min(420px, 92vw);
  box-shadow: var(--sh-shadow-deep);
}
.sh-modal h2 { font-size: 1.3rem; margin-bottom: 1rem; letter-spacing: -0.02em; }
.sh-modal p { color: var(--pb-muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
.sh-modal input {
  width: 100%; padding: 0.75rem 1rem; margin-bottom: 0.75rem;
  background: var(--pb-bg); border: 1px solid var(--sh-border); border-radius: 10px;
  color: var(--pb-text); font: inherit; outline: none;
}
.sh-modal input:focus { border-color: var(--pb-accent); }
.sh-modal .actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.5rem; }
.sh-modal button {
  padding: 0.65rem 1.25rem; border: 0; border-radius: 10px;
  font: inherit; font-weight: 600;
}
.sh-modal .cancel { background: transparent; color: var(--pb-muted); }
.sh-modal .submit { background: var(--pb-accent); color: var(--pb-bg); }

/* MapLibre popup + control overrides — match the rest of the shell. */
.maplibregl-popup-content {
  background: var(--sh-card) !important;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  color: var(--pb-text) !important; border: 1px solid var(--sh-border);
  border-radius: 12px; padding: 0.9rem 1.1rem !important;
  font: 14px/1.4 system-ui;
}
.maplibregl-popup-tip { border-top-color: var(--sh-card) !important; }
.maplibregl-popup-close-button { color: var(--pb-muted) !important; padding: 0.5rem 0.7rem !important; }
.maplibregl-ctrl-group { background: var(--sh-card) !important; }
.maplibregl-ctrl-group button { background: transparent !important; color: var(--pb-text) !important; }

/* Custom pin — accent teardrop with pulsing dot underneath.
 *
 *   .sh-pin           ← MapLibre owns this. NEVER set transform/transition
 *                       here; MapLibre writes inline transform: translate(...)
 *                       on every pan/zoom frame and any CSS transform/
 *                       transition would either fight or lag those updates.
 *   .sh-pin-scaler    ← we own this. Holds the scale-with-zoom transform.
 *
 * Size scales with map zoom via --sh-pin-scale (set by agora.js on every
 * map 'zoom' event). Defaults to 1 if unset so old behaviour is preserved.
 */
:root { --sh-pin-scale: 1; }
/* CRITICAL: do not declare `position`, `transform`, or `transition` on
   .sh-pin — MapLibre writes inline style.position=absolute and
   style.transform=translate(x,y) on this element every render frame.
   Anything we set in CSS would either lose to the inline (no-op) or,
   worse, attach a CSS transition that animates MapLibre's per-frame
   translate updates → markers visibly drift behind the map during
   pan/zoom. Size only.

   The visual is rendered by .sh-pin-scaler — a normal child we fully
   own, scale + transition live there. */
.sh-pin { width: 30px; height: 30px; cursor: pointer; }
.sh-pin-scaler {
  width: 100%; height: 100%;
  position: relative;
  transform: scale(var(--sh-pin-scale));
  transform-origin: bottom center;
  transition: transform 0.15s linear;
  will-change: transform;
}
.sh-pin-scaler .body {
  width: 100%; height: 100%; border-radius: 50% 50% 50% 0;
  background: var(--pb-accent); border: 2px solid var(--pb-bg);
  transform: rotate(-45deg);
  box-shadow: 0 4px 16px var(--sh-accent-glow);
}
.sh-pin-scaler .pulse {
  position: absolute; left: 50%; bottom: -4px;
  width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: var(--pb-accent); opacity: 0.6;
  animation: ping 2s ease-out infinite;
}
@keyframes ping {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(3);   opacity: 0; }
}

/* =====================================================================
 * Welt-Picker — the agoryx.eu/ landing. Embedded inside shell.html via
 * .picker class on body and surfaces a grid of vertical cards.
 * ===================================================================== */
.picker .picker-header {
  padding: 7rem 2rem 3rem;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
}

/* Big logotype — animated 7-stop spectrum that drifts slowly so it feels
   alive but never distracts. Lowercase + tight letter-spacing matches the
   -yx house style (motoryx, helpyx, barteryx…). */
.picker .picker-mark {
  font: 800 clamp(4.5rem, 11vw, 8rem)/0.9 "Inter Tight", ui-sans-serif, system-ui;
  letter-spacing: -0.075em;
  margin-bottom: 1.5rem;
  background: linear-gradient(120deg,
    #f97316 0%,    /* motor */
    #f59e0b 14%,
    #84cc16 28%,   /* barter */
    #06b6d4 44%,   /* byte */
    #8b5cf6 60%,   /* skill/work */
    #ec4899 76%,   /* care */
    #fb923c 90%,   /* help */
    #f97316 100%
  );
  background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: agoryx-spectrum 18s ease-in-out infinite;
  filter: drop-shadow(0 6px 24px rgba(249,115,22,0.18));
}
@keyframes agoryx-spectrum {
  0%, 100% { background-position:   0% 50%; }
  50%      { background-position: 100% 50%; }
}

.picker .picker-tagline {
  color: var(--pb-text);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 300;
  letter-spacing: -0.015em;
  opacity: 0.92;
}
/* "kostenlos nutzbar" claim — subtle pill in lime accent (associates with
   barteryx, the most "no money" of the monetized verticals — bridges to
   the sacred-world feel without being shouty). */
.picker .picker-free {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin-top: 1.25rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  background: rgba(132,204,22,0.10);
  border: 1px solid rgba(132,204,22,0.28);
  color: #d9f99d;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.picker .picker-free .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #84cc16;
  box-shadow: 0 0 0 3px rgba(132,204,22,0.22);
  animation: free-blink 2.4s ease-in-out infinite;
}
@keyframes free-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.picker .picker-sub {
  color: var(--pb-muted);
  font-size: 0.98rem;
  margin: 1.75rem auto 0;
  max-width: 600px;
  line-height: 1.7;
  opacity: 0.85;
}

.picker .picker-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
@media (min-width: 1100px) {
  .picker .picker-grid { grid-template-columns: repeat(3, 1fr); }
}

.picker .world {
  position: relative;
  display: flex; flex-direction: column;
  padding: 2.5rem 2rem 2rem;
  border-radius: 24px;
  background: var(--w-surface, var(--pb-surface));
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
  text-decoration: none;
  min-height: 280px;
  transition:
    transform     0.45s cubic-bezier(0.16, 1, 0.3, 1),
    border-color  0.30s ease,
    box-shadow    0.45s ease;
  opacity: 0; transform: translateY(24px);
  animation: world-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes world-in {
  to { opacity: 1; transform: translateY(0); }
}
/* Stagger fade-in so the picker reveals like a deck */
.picker .world:nth-child(1) { animation-delay: 0.04s; }
.picker .world:nth-child(2) { animation-delay: 0.10s; }
.picker .world:nth-child(3) { animation-delay: 0.16s; }
.picker .world:nth-child(4) { animation-delay: 0.22s; }
.picker .world:nth-child(5) { animation-delay: 0.28s; }
.picker .world:nth-child(6) { animation-delay: 0.34s; }
.picker .world:nth-child(7) { animation-delay: 0.40s; }
.picker .world:nth-child(8) { animation-delay: 0.46s; }
.picker .world:nth-child(9) { animation-delay: 0.52s; }
.picker .world:nth-child(10) { animation-delay: 0.58s; }

.picker .world::before {
  content: ''; position: absolute;
  left: -35%; top: -35%; width: 85%; height: 85%;
  background: radial-gradient(circle, var(--w-accent, var(--pb-accent)) 0%, transparent 65%);
  opacity: 0.16; pointer-events: none;
  transition: opacity 0.4s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.picker .world:hover {
  transform: translateY(-8px);
  border-color: var(--w-accent, var(--pb-accent));
  box-shadow:
    0 30px 80px -25px var(--w-shadow, var(--sh-accent-glow)),
    0 0 0 1px var(--w-accent, var(--pb-accent));
}
.picker .world:hover::before {
  opacity: 0.34;
  transform: scale(1.25);
}

/* Sacred worlds get a slow soft halo so they read as "different" without
   shouting. Anti-exploitation memory rule: sacred worlds must always look
   special — never blend into the monetized grid. */
.picker .world.sacred {
  border-color: rgba(251,146,60,0.18);
}
.picker .world.sacred::after {
  content: ''; position: absolute; inset: -1px; border-radius: 24px;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(251,146,60,0.0);
  animation: sacred-halo 4s ease-in-out infinite;
}
@keyframes sacred-halo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,146,60,0.05); }
  50%      { box-shadow: 0 0 0 8px rgba(251,146,60,0.0); }
}

.picker .world .brand {
  font: 800 1.65rem/1 "Inter Tight", ui-sans-serif, system-ui;
  letter-spacing: -0.045em;
  color: var(--w-accent, var(--pb-accent));
  margin-bottom: 0.45rem;
  position: relative; z-index: 1;
}
.picker .world .display {
  font-size: 0.78rem;
  color: var(--pb-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  position: relative; z-index: 1;
}
.picker .world .tagline {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  line-height: 1.45;
  color: var(--pb-text);
  position: relative; z-index: 1;
  opacity: 0.92;
}
.picker .world .examples {
  margin-top: 1.5rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  position: relative; z-index: 1;
}
.picker .world .examples span {
  font-size: 0.78rem;
  color: var(--pb-muted);
  padding: 0.35rem 0.8rem;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  display: inline-block;
  max-width: fit-content;
}
.picker .world .count {
  margin-top: auto; padding-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--w-accent, var(--pb-accent));
  opacity: 0.9;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 0.4rem;
  transition: gap 0.3s ease;
}
.picker .world:hover .count { gap: 0.7rem; }
.picker .world .badge {
  position: absolute; top: 1.5rem; right: 1.5rem;
  font-size: 0.66rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--pb-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  z-index: 1;
}
.picker .world.sacred .badge {
  background: rgba(251,146,60,0.16);
  color: #fb923c;
}

.picker .picker-footer {
  padding: 3rem 2rem 4rem;
  text-align: center;
  color: var(--pb-muted);
  font-size: 0.82rem;
  border-top: 1px solid rgba(255,255,255,0.04);
  opacity: 0.75;
  line-height: 1.8;
}
.picker .picker-footer .stack {
  letter-spacing: 0.12em; text-transform: uppercase;
  font-size: 0.72rem; opacity: 0.6;
}
.picker .picker-footer a {
  color: var(--pb-text);
  border-bottom: 1px dotted var(--pb-muted);
  margin: 0 0.6rem;
}
.picker .picker-footer a:hover { color: var(--pb-accent); border-bottom-color: var(--pb-accent); }

/* Reduced motion — respect user preference. Drop the spectrum animation
   and stagger, but keep the gradient itself + the hover lift. */
@media (prefers-reduced-motion: reduce) {
  .picker .picker-mark { animation: none; }
  .picker .picker-free .dot { animation: none; }
  .picker .world { opacity: 1; transform: none; animation: none; }
  .picker .world.sacred::after { animation: none; }
}

/* =====================================================================
 * Chat-only surface — chat.html. Shares the design tokens above, so the
 * brand-aware theming and accent glows transfer 1:1; only layout differs:
 * a vertical column with a sticky input bar instead of the full-bleed map.
 * Kept in this one file so chat surfaces inherit any future shell token
 * change without a second edit.
 * ===================================================================== */
body.chat-only {
  overflow: auto;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.chat-header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--sh-border);
  display: flex; gap: 1rem; align-items: baseline;
  background: var(--pb-bg);
}
.chat-header .brand {
  font: 700 1.3rem/1 ui-sans-serif, "Inter Tight", system-ui;
  letter-spacing: -0.04em; color: var(--pb-text);
}
.chat-header .tagline { color: var(--pb-muted); font-size: 0.85rem; }
.chat-header .back {
  margin-left: auto; font-size: 0.78rem;
  color: var(--pb-muted); letter-spacing: 0.06em; text-transform: uppercase;
}
.chat-header .back:hover { color: var(--pb-accent); }

.chat-transcript {
  flex: 1; max-width: 760px; width: 100%;
  margin: 0 auto; padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.chat-msg {
  padding: 0.85rem 1.15rem; border-radius: 14px;
  max-width: 85%; white-space: pre-wrap; line-height: 1.5;
}
.chat-msg.agent {
  background: var(--sh-card); align-self: flex-start;
  border: 1px solid var(--sh-border);
}
.chat-msg.user {
  background: var(--pb-accent); color: var(--pb-bg);
  align-self: flex-end; font-weight: 500;
}
.chat-msg.system {
  background: transparent; border: 1px solid var(--sh-border);
  color: var(--pb-muted); align-self: center; font-size: 0.78rem;
  font-family: ui-monospace, "JetBrains Mono", monospace;
}
.chat-input-wrap {
  position: sticky; bottom: 0; padding: 0.75rem 1rem 1.25rem;
  background: linear-gradient(to top, var(--pb-bg) 60%, transparent);
}
.chat-input-form {
  max-width: 760px; margin: 0 auto;
  display: flex; gap: 0.5rem; align-items: center;
  background: var(--sh-card);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--sh-border); border-radius: 16px;
  padding: 0.65rem 0.65rem 0.65rem 1.25rem;
}
.chat-input {
  flex: 1; padding: 0.65rem 0;
  border: 0; background: transparent; color: var(--pb-text);
  font: inherit; outline: none;
}
.chat-input::placeholder { color: var(--pb-muted); }
.chat-send {
  border: 0; border-radius: 10px; padding: 0.6rem 1rem;
  background: var(--pb-accent); color: var(--pb-bg);
  font: inherit; font-weight: 600; min-width: 3rem;
}
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }
