/* SENDi! prototype — action-first shell over Space (opt-in via ?sendi=1) */

body.sendi-active .space-share.chat-first-shell {
  /* Keep Space infra live underneath; SENDi owns attention. */
}

body.sendi-active #space-quick-pick,
body.sendi-active #space-relationship-step.grigsi-wizard-overlay:not(.hidden) {
  /* relation step still allowed; quick pick replaced by SENDi home */
}

body.sendi-active.sendi-shell-open #space-quick-pick {
  display: none !important;
}

body.sendi-active #space-connect-bridge,
body.sendi-active .space-connect-bridge {
  display: none !important;
}

#sendi-shell {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 196, 120, 0.18), transparent 55%),
    linear-gradient(165deg, #1a1410 0%, #0c0b0a 48%, #12181c 100%);
  color: #f4efe6;
  font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
}

body.sendi-shell-open #sendi-shell {
  display: flex;
}

.sendi-shell__inner {
  width: min(420px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
}

.sendi-brand {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.sendi-brand__bang {
  color: #f0a35a;
}

.sendi-lead {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: rgba(244, 239, 230, 0.92);
}

.sendi-sub {
  margin: -0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(244, 239, 230, 0.62);
}

.sendi-actions {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.sendi-btn {
  appearance: none;
  border: 0;
  border-radius: 18px;
  padding: 1.15rem 1rem;
  font: inherit;
  font-weight: 750;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.sendi-btn:active {
  transform: scale(0.98);
}

.sendi-btn--send {
  background: #f0a35a;
  color: #1a120a;
  font-size: 1.35rem;
}

.sendi-btn--bang {
  background: rgba(255, 255, 255, 0.08);
  color: #f0a35a;
  font-size: 1.8rem;
  border: 1px solid rgba(240, 163, 90, 0.35);
}

.sendi-btn--done-sm {
  background: #f0a35a;
  color: #1a120a;
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.sendi-bang-count {
  appearance: none;
  border: 1px solid rgba(240, 163, 90, 0.4);
  background: rgba(240, 163, 90, 0.12);
  color: #f0a35a;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0 auto;
}

.sendi-bang-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(244, 239, 230, 0.18);
  background: rgba(0, 0, 0, 0.28);
  color: #f4efe6;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  padding: 0.85rem 1rem;
  resize: vertical;
  min-height: 5.5rem;
}

.sendi-bang-input:focus {
  outline: 2px solid rgba(240, 163, 90, 0.45);
  outline-offset: 1px;
}

.sendi-bang-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
  max-height: min(42vh, 320px);
  overflow: auto;
}

.sendi-bang-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(244, 239, 230, 0.1);
}

.sendi-bang-row__text {
  margin: 0;
  flex: 1;
  font-size: 0.98rem;
  line-height: 1.35;
  color: rgba(244, 239, 230, 0.92);
}

.sendi-kinds {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.sendi-kind {
  appearance: none;
  border: 1px solid rgba(244, 239, 230, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #f4efe6;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.sendi-kind:hover,
.sendi-kind:focus-visible {
  border-color: rgba(240, 163, 90, 0.55);
  outline: none;
}

.sendi-kind[disabled] {
  opacity: 0.4;
  cursor: default;
}

.sendi-status {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  color: rgba(244, 239, 230, 0.7);
}

.sendi-panel {
  display: none;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.sendi-panel.is-active {
  display: flex;
}

.sendi-done-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(240, 163, 90, 0.16);
  color: #f0a35a;
  font-size: 2rem;
  font-weight: 800;
}

.sendi-meta {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(244, 239, 230, 0.55);
  word-break: break-word;
}

.sendi-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.sendi-linkish {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(244, 239, 230, 0.72);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}

.sendi-qr-host {
  width: min(220px, 70vw);
  min-height: 180px;
  margin: 0.25rem auto 0;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  display: none;
}

.sendi-qr-host.is-on {
  display: block;
}

.sendi-qr-host img,
.sendi-qr-host canvas {
  width: 100% !important;
  height: auto !important;
}
