:root {
  --bg: #1c1c26;
  --ink: #ece7dc;
  --mute: rgba(236, 231, 220, 0.46);
  --ease-ui: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  background: radial-gradient(900px 600px at 50% 38%, #262632 0%, var(--bg) 68%);
}

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

main {
  height: 100dvh;
}

#stage {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
}

.ask {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 18px;
  border-radius: 999px;
  background: transparent;
  z-index: 2;
  transition-property: background-color, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-ui);
}

.ask:focus-within {
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ask input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.ask input::placeholder {
  color: var(--mute);
}

.mic {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  touch-action: none;
  transform: scale(1);
  transition-property: transform, background-color, color;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-ui);
}

.mic:active {
  transform: scale(0.96);
}

.mic[aria-pressed="true"] {
  background: rgba(236, 231, 220, 0.92);
  color: #111;
}

.mic[aria-busy="true"] svg {
  opacity: 0;
}

.mic[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: mic-spin 0.7s linear infinite;
}

@keyframes mic-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mic {
    transition-duration: 0.01ms;
  }

  .mic[aria-busy="true"] svg {
    opacity: 0.4;
  }

  .mic[aria-busy="true"]::after {
    animation: none;
    opacity: 0;
  }
}

html.share,
html.share body {
  overflow: hidden;
}

html.share main {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

html.share #stage {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

html.share .ask {
  position: static;
  transform: none;
  left: auto;
  bottom: auto;
  width: 100%;
  padding: 20px 32px 36px;
  gap: 14px;
}

html.share .ask input {
  height: 76px;
  font-size: 40px;
}

html.share .mic {
  width: 76px;
  height: 76px;
}
