:root {
  color-scheme: dark;
  --bg: #0f0f14;
  --text: #f2f2f7;
  --muted: #a1a1aa;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

html {
  height: -webkit-fill-available;
}

body.app-chat {
  overflow: hidden;
  overscroll-behavior: none;
  min-height: 100dvh;
  min-height: 100svh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
}

.shell {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.shell--chat {
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  height: 100dvh;
  height: 100svh;
  height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.embed-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  padding: var(--safe-top) 0 var(--safe-bottom);
}

.embed-error {
  margin: 2rem auto;
  padding: 0 1.25rem;
  max-width: 22rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

agent-chat-widget {
  display: block !important;
  flex: 1 1 auto;
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  z-index: 1 !important;
}

@supports (height: 100dvh) {
  .shell--chat,
  .embed-shell,
  agent-chat-widget {
    min-height: 0;
  }
}

.setup {
  margin: auto;
  padding: 2rem;
  max-width: 28rem;
  text-align: center;
}

.setup code {
  font-size: 0.9em;
}

.setup p {
  color: var(--muted);
  line-height: 1.5;
}