:root {
  color-scheme: dark;
  --bg: #050813;
  --bg-2: #081120;
  --panel: rgba(12, 18, 32, 0.92);
  --panel-2: rgba(17, 27, 47, 0.9);
  --line: rgba(151, 177, 255, 0.22);
  --line-strong: rgba(151, 177, 255, 0.42);
  --text: #f6f8ff;
  --muted: #a9b8d5;
  --dim: #7f8da8;
  --cobalt: #1f5eff;
  --cobalt-2: #75a0ff;
  --violet: #9b5cff;
  --pink: #ea4da1;
  --green: #25d0a2;
  --danger: #f07b8b;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 4%, rgba(31, 94, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 86% 44%, rgba(234, 77, 161, 0.10), transparent 24rem),
    linear-gradient(145deg, #050813 0%, #091222 44%, #050813 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(151, 177, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 177, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 75%);
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.home-pill svg,
.live-launch svg,
.speak-toggle svg,
.mini-speak svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 34px;
}

.home-pill,
.home-ghost,
.tool-btn,
.ghost-btn,
.send-btn,
.live-launch,
.speak-toggle,
.mic-btn,
.mini-speak {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.home-pill,
.home-ghost,
.tool-btn,
.ghost-btn {
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.home-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
}

.brand {
  width: 178px;
  min-height: 118px;
  display: grid;
  place-items: center;
  justify-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.26);
}

.brand.small {
  width: 142px;
  min-height: 88px;
}

.brand img {
  width: 100%;
  height: auto;
  display: block;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.tool-btn {
  min-width: 56px;
  min-height: 46px;
  padding: 0 14px;
}

.voice-select {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 900;
}

.voice-select span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.voice-select select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.voice-select option {
  color: #0b1020;
  background: #fff;
}

.status-dot {
  width: 46px;
  aspect-ratio: 1;
  border: 1px solid rgba(37, 208, 162, 0.44);
  border-radius: 999px;
  background: rgba(37, 208, 162, 0.1);
  position: relative;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  background: var(--dim);
  box-shadow: 0 0 0 7px rgba(127, 141, 168, 0.14);
}

.status-dot.online::after {
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(37, 208, 162, 0.16), 0 0 26px rgba(37, 208, 162, 0.55);
}

.intro {
  max-width: 820px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #abc1ff;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3rem, 9vw, 8.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.6rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.live-launch {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  min-width: min(100%, 320px);
  border: 0;
  padding: 12px 18px;
  text-align: left;
  background: linear-gradient(135deg, var(--cobalt), var(--violet) 58%, var(--pink));
  box-shadow: 0 14px 40px rgba(31, 94, 255, 0.25);
}

.live-launch small {
  grid-column: 2;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 650;
}

.home-ghost,
.ghost-btn {
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
}

.conversation {
  margin-top: 16px;
}

.messages {
  min-height: 222px;
  max-height: 42vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 2px 16px;
}

.bubble {
  width: min(100%, 680px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  padding: 15px 17px 10px;
}

.bubble.user {
  align-self: end;
  background: rgba(31, 94, 255, 0.16);
  border-color: rgba(117, 160, 255, 0.4);
}

.bubble p {
  margin-bottom: 10px;
  line-height: 1.5;
}

.bubble footer {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--dim);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-speak {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  background: rgba(31, 94, 255, 0.14);
}

.composer,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.3);
}

.composer {
  position: relative;
  padding: 18px;
  z-index: 2;
}

.composer-tools {
  display: flex;
  justify-content: end;
  margin-bottom: 8px;
}

.speak-toggle {
  width: 42px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(31, 94, 255, 0.14);
}

.speak-toggle.off {
  opacity: 0.52;
}

.input-wrap {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid rgba(151, 177, 255, 0.22);
  border-radius: var(--radius);
  outline: none;
  background: rgba(4, 8, 16, 0.8);
  color: var(--text);
  padding: 17px 68px 17px 18px;
  line-height: 1.5;
}

textarea:focus {
  border-color: rgba(117, 160, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.14);
}

.mic-btn {
  width: 52px;
  aspect-ratio: 1;
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #050813;
  color: #eef4ff;
}

.mic-btn svg,
.orb svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mic-btn.listening {
  background: linear-gradient(135deg, var(--cobalt), var(--pink));
  box-shadow: 0 0 0 8px rgba(234, 77, 161, 0.12), 0 0 28px rgba(234, 77, 161, 0.4);
}

.composer-bottom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 12px;
}

.mic-status,
.bridge-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.bridge-note {
  margin-top: 5px;
  color: var(--dim);
}

.send-btn {
  min-width: 112px;
  min-height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: linear-gradient(135deg, var(--cobalt), var(--violet) 55%, var(--pink));
  box-shadow: 0 14px 34px rgba(31, 94, 255, 0.25);
}

.send-btn:disabled {
  opacity: 0.68;
  cursor: wait;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 20px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-list div {
  border: 1px solid rgba(151, 177, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 13px 14px;
}

.task-list strong,
.task-list small {
  display: block;
}

.task-list small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.progress-line {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  margin: 12px 0 14px;
}

.progress-line span {
  font-weight: 950;
  font-size: 1.15rem;
}

.progress-line div {
  height: 12px;
  border-radius: 999px;
  background: rgba(151, 177, 255, 0.16);
  overflow: hidden;
}

.progress-line i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cobalt), var(--cobalt-2));
  transition: width 0.35s ease;
}

#progressFocus {
  color: var(--muted);
  line-height: 1.48;
}

.live-screen {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 20;
  background:
    radial-gradient(circle at 50% 38%, rgba(31, 94, 255, 0.16), transparent 26rem),
    radial-gradient(circle at 72% 58%, rgba(234, 77, 161, 0.12), transparent 22rem),
    #050813;
}

.live-screen.open {
  display: block;
}

.live-inner {
  width: min(760px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0 34px;
}

.live-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 42px;
}

.ghost-btn.danger {
  color: #ffc3cc;
  background: rgba(240, 123, 139, 0.12);
  border-color: rgba(240, 123, 139, 0.34);
}

.live-copy {
  color: var(--muted);
  margin-bottom: 28px;
}

.live-copy p:last-child {
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.45;
}

.orb {
  width: min(42vw, 188px);
  min-width: 150px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--cobalt), var(--violet) 50%, var(--pink));
  box-shadow:
    0 0 0 18px rgba(31, 94, 255, 0.08),
    0 0 0 38px rgba(155, 92, 255, 0.055),
    0 0 78px rgba(234, 77, 161, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.orb.listening {
  animation: pulse 1.2s ease-in-out infinite;
}

.orb.thinking svg {
  animation: spin 1s linear infinite;
}

.orb.speaking {
  box-shadow:
    0 0 0 18px rgba(37, 208, 162, 0.08),
    0 0 0 38px rgba(31, 94, 255, 0.055),
    0 0 78px rgba(37, 208, 162, 0.34);
}

#liveStatus {
  margin: 42px 0 8px;
  font-size: clamp(1.5rem, 5vw, 2.35rem);
}

#liveHint {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.48;
}

.live-meter {
  width: min(100%, 420px);
  height: 10px;
  margin-top: 16px;
  border: 1px solid rgba(151, 177, 255, 0.22);
  border-radius: 999px;
  background: rgba(151, 177, 255, 0.1);
  overflow: hidden;
}

.live-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cobalt), var(--green));
  transition: width 0.08s linear;
}

.live-transcript {
  width: min(100%, 620px);
  min-height: 110px;
  max-height: 30vh;
  overflow: auto;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.live-transcript:empty {
  display: none;
}

.live-transcript p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.live-transcript p:last-child {
  margin-bottom: 0;
}

.live-transcript strong {
  color: var(--text);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

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

@media (max-width: 820px) {
  .shell {
    width: min(100% - 22px, 620px);
    padding-top: 14px;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }

  .brand {
    order: 3;
    grid-column: 1 / -1;
    width: 154px;
    min-height: 96px;
  }

  .toolbar {
    justify-content: end;
  }

  h1 {
    font-size: clamp(3.2rem, 20vw, 6.8rem);
  }

  .messages {
    max-height: none;
    min-height: 180px;
  }

  .composer {
    bottom: 8px;
    padding: 14px;
  }

  .composer-bottom {
    grid-template-columns: 1fr;
  }

  .send-btn {
    justify-self: end;
  }

  .lower-grid {
    grid-template-columns: 1fr;
  }

  .live-head {
    margin-bottom: 28px;
  }

  .brand.small {
    width: 126px;
    min-height: 78px;
  }
}
