/* Prime Vault Chat · ChatGPT-shaped guest door */
:root {
  --pvc-navy: #0b1220;
  --pvc-panel: #121a2b;
  --pvc-ink: #e8eef7;
  --pvc-muted: #9aa8bc;
  --pvc-gold: #d4af37;
  --pvc-gold-hi: #f3e6c4;
  --pvc-teal: #5eead4;
  --pvc-user: #1e2a44;
  --pvc-line: rgba(212, 175, 55, 0.25);
}

.pvc-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--pvc-ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 80% 45% at 20% -10%, rgba(94, 234, 212, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 100%, rgba(212, 175, 55, 0.1), transparent 50%),
    linear-gradient(168deg, #070d18 0%, #0b1220 48%, #10141c 100%);
}

.pvc-site-nav { margin-bottom: 0; }

.pvc-shell {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
  min-height: calc(100vh - 3rem);
  min-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
}

.pvc-brand {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pvc-gold);
}

.pvc-gate h1,
.pvc-chat__head h2 {
  font-family: "Bebas Neue", Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--pvc-gold-hi);
  margin: 0 0 0.6rem;
  font-size: clamp(2.2rem, 9vw, 3.3rem);
}

.pvc-chat__head h2 { font-size: clamp(1.7rem, 5vw, 2.3rem); }

.pvc-gate__lead,
.pvc-honesty {
  color: var(--pvc-muted);
  line-height: 1.55;
  margin: 0 0 1.2rem;
}

.pvc-honesty {
  border-left: 3px solid var(--pvc-gold);
  padding-left: 0.75rem;
  font-size: 0.92rem;
}

.pvc-honesty a { color: var(--pvc-teal); }

.pvc-gate__form {
  display: grid;
  gap: 0.55rem;
  max-width: 22rem;
}

.pvc-gate__form label {
  font-size: 0.82rem;
  color: var(--pvc-muted);
}

.pvc-gate__form input {
  border: 1px solid var(--pvc-line);
  background: var(--pvc-panel);
  color: var(--pvc-ink);
  border-radius: 0.55rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
}

.pvc-btn {
  appearance: none;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #d4af37, #b8922a);
  color: #0b1220;
}

.pvc-btn:disabled { opacity: 0.55; cursor: wait; }

.pvc-btn--ghost {
  background: transparent;
  color: var(--pvc-gold-hi);
  border: 1px solid var(--pvc-line);
}

.pvc-gate__hint {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  color: var(--pvc-muted);
}

.pvc-gate__hint a { color: var(--pvc-teal); }

.pvc-gate__err {
  margin-top: 0.75rem;
  color: #fb7185;
  font-size: 0.9rem;
}

.pvc-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pvc-chat__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.pvc-chat__actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.pvc-you {
  margin: 0;
  color: var(--pvc-muted);
  font-size: 0.88rem;
}

.pvc-thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.25rem 0 1rem;
  min-height: 14rem;
  max-height: min(58vh, 36rem);
}

.pvc-msg {
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  line-height: 1.5;
  max-width: 92%;
  animation: pvc-in 0.35s ease-out both;
}

@keyframes pvc-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.pvc-msg--user {
  align-self: flex-end;
  background: var(--pvc-user);
  border: 1px solid rgba(94, 234, 212, 0.2);
}

.pvc-msg--assistant {
  align-self: flex-start;
  background: var(--pvc-panel);
  border: 1px solid var(--pvc-line);
}

.pvc-msg__role {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pvc-gold);
  margin-bottom: 0.35rem;
}

.pvc-msg__body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  color: var(--pvc-ink);
}

.pvc-msg__body p {
  margin: 0 0 0.65rem;
}

.pvc-msg__body p:last-child {
  margin-bottom: 0;
}

.pvc-msg__body strong {
  color: var(--pvc-gold);
  font-weight: 600;
}

.pvc-msg__metrics {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--pvc-teal);
}

.pvc-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--pvc-line);
  background: rgba(7, 13, 24, 0.96);
  z-index: 40;
}

.pvc-composer textarea {
  resize: none;
  min-height: 2.85rem;
  max-height: 8rem;
  border-radius: 0.85rem;
  border: 1px solid var(--pvc-line);
  background: var(--pvc-panel);
  color: var(--pvc-ink);
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-size: 16px; /* iOS: avoid focus zoom that pushes controls under Safari chrome */
  line-height: 1.4;
  touch-action: manipulation;
}

.pvc-composer #pvc-send {
  min-width: 3.5rem;
  min-height: 2.85rem;
  padding: 0.75rem 1rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pvc-meta {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--pvc-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Mobile dock: keep Message + Send above Safari / Android chrome */
@media (max-width: 720px) {
  .pvc-chat__head { flex-direction: column; }
  .pvc-msg { max-width: 100%; }

  .pvc-chat:not([hidden]) {
    padding-bottom: calc(7.25rem + env(safe-area-inset-bottom, 0px));
  }

  .pvc-thread {
    max-height: none;
    flex: 1 1 auto;
    padding-bottom: 0.5rem;
  }

  .pvc-composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    bottom: var(--pvc-keyboard-inset, 0px);
    z-index: 1300;
    margin: 0;
    padding: 0.7rem 0.85rem 0.35rem;
    padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--pvc-line);
    background:
      linear-gradient(180deg, rgba(7, 13, 24, 0.92), #070d18 35%);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    grid-template-columns: 1fr auto;
  }

  .pvc-meta {
    position: fixed;
    left: 0.85rem;
    right: 0.85rem;
    bottom: calc(3.55rem + env(safe-area-inset-bottom, 0px) + var(--pvc-keyboard-inset, 0px));
    z-index: 1299;
    margin: 0;
    padding: 0.2rem 0;
    background: transparent;
    pointer-events: none;
    font-size: 0.72rem;
  }

  body.pvc-chat-open .qv-page-views,
  body.pvc-chat-open #qv-page-views,
  body.pvc-chat-open [data-qv-page-views] {
    bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px) + var(--pvc-keyboard-inset, 0px)) !important;
  }
}
