/* ════════════════════════════════════════════════════════════════════════════════
   WP-14 — Weya FAB shell (launch site, plain CSS, no pulse)
   WP-R4 — Adds offered-suggestion surface via shared SafeRoomCard (hero+FAB
   consistency, bounded 2, honest empty/degraded, no urgency).
   Collapsed, silent, no badge, no attention-seeking motion. Signed-in only.
   Respects prefers-reduced-motion and [data-motion="reduce"].
   ════════════════════════════════════════════════════════════════════════════════ */

/* ─── FAB root — lives inside #hero, positioned at hero's bottom-right ─── */
.weya-fab-root {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.weya-fab-root[hidden] {
  display: none !important;
}

/* The hero provides the positioning context */
#hero {
  position: relative;
}

/* ─── FAB button — small, quiet, no pulse ─── */
.weya-fab {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid rgba(45, 212, 191, 0.28);
  background: rgba(15, 21, 32, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(45, 212, 191, 0.06);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  user-select: none;
}
.weya-fab:hover {
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.45);
  transform: translateY(-1px);
}
.weya-fab:active {
  transform: translateY(0);
}
.weya-fab:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.weya-fab[aria-expanded="true"] {
  background: var(--teal);
  color: #04121a;
  border-color: var(--teal);
}
.weya-fab-icon {
  font-size: 1rem;
  line-height: 1;
}
.weya-fab-text {
  line-height: 1;
}

/* ─── Panel — disclosure surface ─── */
.weya-fab-panel {
  pointer-events: auto;
  position: absolute;
  bottom: 58px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(68vh, 560px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #0f1520 0%, #0d1117 100%);
  border: 1px solid rgba(45, 212, 191, 0.16);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(45, 212, 191, 0.06);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.weya-fab-panel.open {
  opacity: 1;
  transform: none;
}
.weya-fab-panel[hidden] {
  display: none !important;
}
.weya-fab-panel-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}
.weya-fab-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}
.weya-fab-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.weya-fab-close {
  background: rgba(45, 212, 191, 0.08);
  border: 1.5px solid rgba(45, 212, 191, 0.25);
  color: var(--teal);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.weya-fab-close:hover {
  background: rgba(45, 212, 191, 0.18);
  border-color: var(--teal);
}
.weya-fab-close:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.weya-fab-intro {
  margin: 0;
  padding: 12px 18px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.weya-fab-body {
  padding: 14px 18px 16px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 212, 191, 0.15) transparent;
}
.weya-fab-body::-webkit-scrollbar {
  width: 4px;
}
.weya-fab-body::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.2);
  border-radius: 2px;
}

/* Actions stack */
.weya-fab-actions {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.weya-fab-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}
.weya-fab-action-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.weya-fab-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.weya-fab-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.weya-fab-input::placeholder {
  color: var(--text-dim);
}
.weya-fab-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
}
.weya-fab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-height: 40px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #06101a;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 4px 16px rgba(45, 212, 191, 0.28);
}
.weya-fab-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(45, 212, 191, 0.4);
}
.weya-fab-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.weya-fab-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.weya-fab-btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid rgba(45, 212, 191, 0.35);
  box-shadow: none;
  width: 100%;
}
.weya-fab-btn-ghost:hover {
  background: rgba(45, 212, 191, 0.08);
  box-shadow: none;
  transform: none;
}
.weya-fab-status {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  min-height: 1.2em;
}
.weya-fab-status.error {
  color: #f87171;
}
.weya-fab-status.ok {
  color: var(--teal);
}
.weya-fab-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.weya-fab-card {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}
.weya-fab-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.weya-fab-card-purpose {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.weya-fab-card-fit {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 6px;
}
.weya-fab-card-req {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.weya-fab-card-join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(45, 212, 191, 0.35);
  background: transparent;
  color: var(--teal);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.weya-fab-card-join:hover {
  background: rgba(45, 212, 191, 0.1);
}
.weya-fab-card-join:disabled {
  opacity: 0.5;
  cursor: default;
}
.weya-fab-card-join.joined {
  background: rgba(45, 212, 191, 0.14);
  border-color: var(--teal);
  color: var(--teal);
}
.weya-fab-card-msg {
  font-size: 0.78rem;
  line-height: 1.45;
  margin-top: 6px;
  color: var(--text-muted);
}
.weya-fab-card-msg.error {
  color: #f87171;
}
.weya-fab-card-msg.joined-msg {
  color: var(--teal);
}
.weya-fab-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 2px 0;
}
.weya-fab-foot-note {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: center;
  padding: 0 4px;
}

/* WP-R4 — FAB suggestions wrap (populated via SafeRoomCard) */
.weya-fab-suggestions {
  margin-bottom: 12px;
}
.weya-fab-suggestions:empty {
  display: none;
}

/* Reduced motion — no transitions, no transform animation */
@media (prefers-reduced-motion: reduce) {
  .weya-fab,
  .weya-fab-panel {
    transition: none !important;
  }
}
:root[data-motion="reduce"] .weya-fab,
:root[data-motion="reduce"] .weya-fab-panel {
  transition: none !important;
}

/* Responsive — keep panel readable and FAB clear of sticky CTA */
@media (max-width: 768px) {
  .weya-fab-root {
    bottom: 84px;
    right: 12px;
  }
  .weya-fab-panel {
    width: calc(100vw - 24px);
    right: 0;
    bottom: 56px;
    max-height: min(62vh, 520px);
  }
}
@media (max-width: 480px) {
  .weya-fab {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
  .weya-fab-panel {
    max-height: 58vh;
  }
  .weya-fab-row {
    flex-direction: column;
    align-items: stretch;
  }
  .weya-fab-row .weya-fab-btn {
    width: 100%;
  }
}
