/* SquEEK chat widget — Forman Pacific premier gold theme */
.fp-squeek-root {
  --sq-gold: #b8926a;
  --sq-gold-light: #d4b483;
  --sq-gold-bright: #e8d9b8;
  --sq-gold-deep: #7a5c32;
  --sq-ink: #0c0b0a;
  --sq-ink-soft: #141210;
  --sq-ink-panel: #1a1714;
  --sq-line: rgba(184, 146, 106, 0.35);
  --sq-glow: rgba(232, 217, 184, 0.18);
  --sq-kb-inset: 0px;
  --sq-vv-height: 100dvh;
  --sq-vv-offset-top: 0px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  z-index: 10050;
}

html.fp-build-pending .fp-squeek-root {
  visibility: hidden;
  pointer-events: none;
}

/* Roundel launcher */
.fp-squeek-roundel {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  border: 1px solid var(--sq-line);
  background: #050608;
  color: var(--sq-ink);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 24px var(--sq-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  padding: 0;
  transition: opacity 0.45s ease, transform 0.35s ease, box-shadow 0.35s ease;
  opacity: 1;
  transform: scale(1);
  z-index: 10051;
}

.fp-squeek-roundel:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 32px var(--sq-glow);
}

.fp-squeek-roundel[data-scrolling="true"] {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85) translateY(8px);
}

.fp-squeek-roundel[hidden] {
  display: none !important;
}

.fp-squeek-roundel.is-post-build-hint {
  animation: fp-sq-roundel-hint 1.8s ease-in-out 3;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 36px rgba(232, 217, 184, 0.45);
}

@keyframes fp-sq-roundel-hint {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.fp-squeek-roundel.is-post-build-hint .fp-squeek-roundel-label {
  opacity: 1;
}

.fp-squeek-roundel-label {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  right: 0;
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sq-gold-bright);
  background: var(--sq-ink-panel);
  border: 1px solid var(--sq-line);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.fp-squeek-roundel:hover .fp-squeek-roundel-label,
.fp-squeek-roundel:focus-visible .fp-squeek-roundel-label {
  opacity: 1;
}

/* Modal backdrop */
.fp-squeek-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.72);
  backdrop-filter: blur(6px);
  z-index: 10052;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1rem;
  animation: fp-sq-fade-in 0.35s ease;
}

.fp-squeek-backdrop[hidden] {
  display: none !important;
}

@keyframes fp-sq-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Chat panel */
.fp-squeek-panel {
  width: min(420px, calc(100vw - 2rem));
  max-height: min(640px, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  background: var(--sq-ink-panel);
  border: 1px solid var(--sq-line);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 40px var(--sq-glow);
  overflow: hidden;
  animation: fp-sq-slide-up 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  min-height: 0;
}

@keyframes fp-sq-slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fp-squeek-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sq-gold-deep), var(--sq-gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--sq-glow);
}

.fp-squeek-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--sq-line);
  background: linear-gradient(180deg, rgba(184, 146, 106, 0.12), transparent);
}

.fp-squeek-title {
  flex: 1;
  min-width: 0;
}

.fp-squeek-title h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--sq-gold-bright);
  letter-spacing: 0.02em;
}

.fp-squeek-title p {
  margin: 0;
  font-size: 0.72rem;
  color: rgba(232, 217, 184, 0.65);
  letter-spacing: 0.04em;
}

.fp-squeek-header-actions {
  display: flex;
  gap: 0.35rem;
}

.fp-squeek-btn-icon {
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--sq-gold-bright);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.fp-squeek-btn-icon:hover:not(:disabled) {
  background: rgba(184, 146, 106, 0.15);
  border-color: var(--sq-line);
}

.fp-squeek-btn-icon:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Messages area */
.fp-squeek-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  max-height: 360px;
}

.fp-squeek-msg {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}

.fp-squeek-msg--assistant {
  align-self: flex-start;
  background: rgba(184, 146, 106, 0.1);
  border: 1px solid var(--sq-line);
  color: var(--sq-gold-bright);
}

.fp-squeek-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--sq-gold-deep), var(--sq-gold));
  color: var(--sq-ink);
}

.fp-squeek-msg--typing {
  opacity: 0.7;
  font-style: italic;
}

.fp-squeek-msg a {
  color: var(--sq-gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.fp-squeek-msg a:active {
  color: var(--sq-gold-bright);
}

/* Terms gate overlay */
.fp-squeek-terms {
  padding: 1.25rem;
  border-top: 1px solid var(--sq-line);
  background: rgba(12, 11, 10, 0.95);
}

.fp-squeek-terms-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(12, 11, 10, 0.97);
  backdrop-filter: blur(4px);
}

.fp-squeek-terms-gate[hidden] {
  display: none !important;
}

.fp-squeek-terms-gate h3 {
  margin: 0 0 0.5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  color: var(--sq-gold-bright);
  font-weight: 500;
}

.fp-squeek-terms-gate p {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: rgba(232, 217, 184, 0.75);
  line-height: 1.55;
}

.fp-squeek-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: rgba(232, 217, 184, 0.85);
  cursor: pointer;
}

.fp-squeek-check input {
  margin-top: 0.15rem;
  accent-color: var(--sq-gold);
}

.fp-squeek-check a {
  color: var(--sq-gold-light);
}

.fp-squeek-btn-primary {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sq-gold-deep), var(--sq-gold));
  color: var(--sq-ink);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.fp-squeek-btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fp-squeek-btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
}

/* Input row */
.fp-squeek-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem max(1rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--sq-line);
  background: var(--sq-ink-soft);
}

.fp-squeek-input-row input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--sq-line);
  border-radius: 8px;
  background: var(--sq-ink);
  color: var(--sq-gold-bright);
  font-size: 0.875rem;
  outline: none;
}

.fp-squeek-input-row input:focus {
  border-color: var(--sq-gold);
}

.fp-squeek-input-row input::placeholder {
  color: rgba(232, 217, 184, 0.4);
}

.fp-squeek-input-row input:disabled {
  opacity: 0.5;
}

.fp-squeek-send {
  flex-shrink: 0;
  min-width: 3.25rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--sq-gold);
  border-radius: 8px;
  background: rgba(184, 146, 106, 0.15);
  color: var(--sq-gold-bright);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}

.fp-squeek-send:hover:not(:disabled) {
  background: rgba(184, 146, 106, 0.28);
}

.fp-squeek-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fp-squeek-panel-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.fp-squeek-footer-note {
  padding: 0.4rem 1rem 0.65rem;
  font-size: 0.65rem;
  color: rgba(232, 217, 184, 0.45);
  text-align: center;
}

.fp-squeek-footer-note a {
  color: rgba(232, 217, 184, 0.6);
}

@media (max-width: 768px) {
  .fp-squeek-backdrop {
    position: fixed;
    top: var(--fp-vv-offset-top, 0px);
    left: 0;
    right: 0;
    height: var(--fp-vv-height, 100dvh);
    bottom: auto;
    padding: 0;
    align-items: flex-end;
    justify-content: center;
  }

  .fp-squeek-panel {
    width: 100%;
    max-width: 100%;
    max-height: calc(var(--fp-vv-height, 100dvh) - var(--sq-kb-inset, 0px) - var(--fp-vv-offset-bottom, 0px) - 0.35rem);
    margin-bottom: var(--sq-kb-inset, 0px);
    border-radius: 14px 14px 0 0;
  }

  .fp-squeek-roundel {
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.35rem;
  }

  .fp-squeek-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sq-gold-deep), var(--sq-gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--sq-glow);
}

.fp-squeek-header {
    padding: 0.85rem 1rem;
    flex-shrink: 0;
  }

  .fp-squeek-messages {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .fp-squeek-input-row {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 2;
    box-sizing: border-box;
    width: 100%;
  }

  .fp-squeek-send {
    min-width: 3rem;
    padding: 0.6rem 0.55rem;
    font-size: 0.75rem;
  }

  .fp-squeek-footer-note {
    flex-shrink: 0;
  }

  .fp-squeek-terms-gate {
    flex-shrink: 0;
    overflow-y: auto;
    max-height: calc(var(--fp-vv-height, 100dvh) - var(--sq-kb-inset, 0px) - var(--fp-vv-offset-bottom, 0px) - 8rem);
  }
}

@media (max-width: 480px) {
  .fp-squeek-panel {
    max-height: calc(var(--fp-vv-height, 100dvh) - var(--sq-kb-inset, 0px) - var(--fp-vv-offset-bottom, 0px));
  }
}
/* Terms-only sheet (mobile post-build) */
@media (max-width: 768px) {
  .fp-squeek-panel.is-terms-only {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: calc(var(--fp-vv-height, 100dvh) - var(--fp-vv-offset-bottom, 0px));
    margin-bottom: var(--fp-vv-offset-bottom, 0px);
    border-radius: 16px 16px 0 0;
  }

  .fp-squeek-panel.is-terms-only .fp-squeek-panel-inner {
    height: auto;
    min-height: 0;
  }

  .fp-squeek-panel.is-terms-only .fp-squeek-terms-gate {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1.35rem 1.25rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
    max-height: none;
    overflow: visible;
    flex-shrink: 0;
  }

  .fp-squeek-panel.is-terms-only .fp-squeek-terms-gate h3 {
    font-size: 1.35rem;
    margin-bottom: 0.65rem;
  }

  .fp-squeek-panel.is-terms-only .fp-squeek-btn-primary {
    margin-top: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
  }
}

