:root {
  color-scheme: dark;
  font-family: Geist, "Segoe UI", sans-serif;
  background: #090a0b;
  color: #f0efec;
  --copper: #eaa176;
  --ink: #101113;
  --surface: #17181a;
  --surface-raised: #1d1e21;
  --border: #2b2d31;
  --muted: #bbbcbd;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #090a0b;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 8%, rgba(234, 161, 118, 0.1), transparent 28rem),
    #090a0b;
}

button {
  font: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.preview-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 120px;
}

.preview-header,
.brand-lockup,
.notice,
.presence-panel-brand {
  display: flex;
  align-items: center;
}

.preview-header {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.brand-lockup {
  gap: 16px;
}

.brand-symbol,
.presence-panel-symbol {
  display: grid;
  flex: none;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
}

.brand-symbol {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.brand-symbol svg {
  width: 30px;
  height: 30px;
}

h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.15;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--copper);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-lockup p:last-child,
.notice p,
.prototype-stage > p:last-child,
.presence-panel-brand p:last-child,
.status {
  color: var(--muted);
  line-height: 1.5;
}

.demo-badge {
  flex: none;
  padding: 8px 12px;
  border: 1px solid rgba(234, 161, 118, 0.45);
  border-radius: 999px;
  color: var(--copper);
  background: rgba(234, 161, 118, 0.08);
  font-size: 0.78rem;
  font-weight: 600;
}

.notice {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(23, 24, 26, 0.88);
}

.notice > div {
  max-width: 680px;
}

.privacy-note {
  max-width: 330px;
  font-size: 0.78rem;
}

.prototype-stage {
  display: grid;
  min-height: min(52vh, 520px);
  place-content: center;
  padding: 72px 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(234, 161, 118, 0.07), transparent 42%),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(255, 255, 255, 0.025) 64px),
    repeating-linear-gradient(0deg, transparent 0 63px, rgba(255, 255, 255, 0.025) 64px),
    var(--ink);
  text-align: center;
}

.prototype-stage h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 7vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.prototype-stage > p:last-child {
  width: min(560px, 100%);
  margin-inline: auto;
}

.presence-dock {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
}

.presence-panel {
  position: fixed;
  z-index: 51;
  right: 24px;
  bottom: 104px;
  display: flex;
  width: min(430px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 128px));
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(234, 161, 118, 0.34);
  border-radius: 22px;
  background: rgba(16, 17, 19, 0.98);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform-origin: right bottom;
  will-change: transform, opacity;
}

.presence-panel-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(23, 24, 26, 0.94);
}

.presence-panel-brand {
  min-width: 0;
  flex: 1;
  gap: 11px;
}

.presence-panel-brand > div {
  min-width: 0;
}

.presence-panel-symbol {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.presence-panel-symbol svg {
  width: 25px;
  height: 25px;
}

.presence-panel-brand h2 {
  font-size: 1rem;
  line-height: 1.15;
}

.presence-panel-brand p:last-child {
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-close {
  min-height: 42px;
  flex: none;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 650;
}

.presence-delete {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  font: inherit;
  font-size: 11px;
}

.presence-delete:hover:not(:disabled),
.presence-delete:focus-visible {
  border-color: var(--copper);
  color: #f0efec;
}

.presence-delete:disabled {
  cursor: wait;
  opacity: .65;
}

.presence-delete[hidden] {
  display: none;
}

.presence-description {
  flex: none;
  padding: 12px 16px 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.processing-disclosure {
  flex: none;
  margin: 10px 16px 0;
  padding: 10px 12px;
  border: 1px solid rgba(234, 161, 118, 0.22);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(234, 161, 118, 0.06);
  font-size: 0.74rem;
  line-height: 1.45;
}

.presence-close:hover {
  border-color: rgba(234, 161, 118, 0.58);
  color: var(--copper);
  background: rgba(234, 161, 118, 0.08);
}

.chat-frame {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  background: var(--ink);
}

openai-chatkit {
  display: block;
  width: 100%;
  height: 100%;
  font-family: Geist, "Segoe UI", sans-serif;
}

.status {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(320px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.status[hidden] {
  display: none;
}

.presence-trigger {
  position: relative;
  z-index: 52;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--copper);
  background: transparent;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}

.presence-pulse-ring,
.presence-hover-ring,
.presence-avatar-core {
  position: absolute;
  border-radius: 50%;
}

.presence-pulse-ring,
.presence-hover-ring {
  inset: 5px;
  z-index: -1;
  border: 1px solid rgba(234, 161, 118, 0.72);
  opacity: 0;
  pointer-events: none;
}

.presence-pulse-ring {
  background: rgba(234, 161, 118, 0.06);
}

.presence-hover-ring {
  border-width: 2px;
  box-shadow: 0 0 28px rgba(234, 161, 118, 0.18);
}

.presence-avatar-core {
  inset: 6px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(234, 161, 118, 0.5);
  background: linear-gradient(145deg, #202124, #101113);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  will-change: transform;
}

.presence-avatar-core svg {
  width: 34px;
  height: 34px;
}

.presence-trigger:focus-visible,
.presence-close:focus-visible {
  outline: 3px solid var(--copper);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .preview-shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0 104px;
  }

  .preview-header,
  .notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .notice {
    padding: 12px 14px;
  }

  .prototype-stage {
    min-height: 360px;
    padding: 52px 18px;
  }
}

@media (max-width: 640px) {
  .presence-dock {
    right: 16px;
    bottom: 16px;
  }

  .presence-panel {
    inset: 10px 10px 88px;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 18px;
  }

  .presence-panel-header {
    min-height: 68px;
    padding: 11px 12px;
  }

  .presence-trigger {
    width: 64px;
    height: 64px;
  }

  .presence-avatar-core svg {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 360px) {
  .presence-panel {
    inset: 8px 8px 88px;
  }

  .presence-panel-symbol {
    display: none;
  }

  .presence-panel-brand {
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .presence-panel,
  .presence-avatar-core,
  .presence-pulse-ring,
  .presence-hover-ring {
    will-change: auto;
  }
}

body[data-embed="true"] {
  min-height: 100dvh;
  overflow: hidden;
  background: transparent;
}

body[data-embed="true"] .preview-shell,
body[data-embed="true"] .presence-trigger,
body[data-embed="true"] #presence-announcer {
  display: none !important;
}

body[data-embed="true"] .presence-dock {
  position: fixed;
  inset: 0;
  z-index: 50;
}

body[data-embed="true"] .presence-panel {
  position: absolute;
  inset: 0;
  width: auto;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform-origin: center;
}

body[data-embed="true"] .presence-close {
  display: none;
}

body[data-embed="true"] .presence-panel-header {
  justify-content: flex-start;
}

body[data-embed="true"] .presence-delete {
  margin-left: auto;
}
