:root {
  color-scheme: dark;
  --bg: #050816;
  --bg-elevated: rgba(10, 16, 30, 0.76);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.065);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eff5ff;
  --muted: rgba(226, 236, 255, 0.66);
  --cyan: #7df9ff;
  --violet: #8b5cf6;
  --emerald: #49f2ac;
  --amber: #ffcb73;
  --rose: #ff7aa2;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100vh;
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(125, 249, 255, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.15), transparent 30%),
    linear-gradient(160deg, #050816 0%, #0b1120 50%, #04070f 100%);
  color: var(--text);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.14;
  pointer-events: none;
}

.ambient {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.22;
  pointer-events: none;
}

.ambient-a {
  background: rgba(125, 249, 255, 0.45);
  top: -8rem;
  left: -6rem;
  animation: floatA 16s ease-in-out infinite;
}

.ambient-b {
  background: rgba(139, 92, 246, 0.42);
  right: -8rem;
  bottom: -6rem;
  animation: floatB 20s ease-in-out infinite;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35) 0.7px, transparent 0.7px),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.22) 0.8px, transparent 0.8px);
  background-size: 18px 18px, 24px 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  backdrop-filter: blur(18px);
  background: rgba(4, 7, 15, 0.62);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar__back,
.topbar__back:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.topbar__back:hover,
.topbar__back:focus-visible {
  color: var(--text);
}

.topbar__brand {
  display: grid;
  gap: 0.1rem;
  justify-items: center;
}

.topbar__brand strong {
  font-family: "Sora", sans-serif;
  letter-spacing: -0.04em;
}

.topbar__eyebrow {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.12);
}

.status-dot.is-live {
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(73, 242, 172, 0.45);
  animation: pulse 1.6s infinite;
}

.status-dot.is-busy {
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(255, 203, 115, 0.42);
  animation: pulse 1.6s infinite;
}

.status-dot.is-error {
  background: var(--rose);
}

.demo-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 1fr;
  gap: 1rem;
  padding: 1rem 1.15rem 1.15rem;
  height: calc(100vh - 68px);
  max-height: calc(100vh - 68px);
}

.glass {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 26px 90px rgba(5, 8, 22, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  border-radius: 28px;
  overflow: hidden;
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(125, 249, 255, 0.1), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.12), transparent 34%);
  pointer-events: none;
}

.control-panel,
.transcript-panel,
.ops-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  height: 100%;
  padding: 1.2rem;
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
}

.panel-heading--compact {
  margin-bottom: 0.15rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

h1,
h2,
h3,
p,
dl,
dd,
dt {
  margin: 0;
}

h1,
h2 {
  font-family: "Sora", sans-serif;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

h1 {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  max-width: 9ch;
}

h2 {
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

h3 {
  font-size: 1.16rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.panel-heading p,
.ops-card p,
.note-card p {
  color: var(--muted);
  line-height: 1.55;
}

.control-panel__actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.control-panel__hero {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(125, 249, 255, 0.18), transparent 48%),
    linear-gradient(135deg, rgba(125, 249, 255, 0.08), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(125, 249, 255, 0.16);
  box-shadow: 0 22px 58px rgba(3, 7, 19, 0.34);
}

.control-panel__prompt {
  color: rgba(239, 245, 255, 0.78);
  font-size: 0.98rem;
}

.control-panel .note-card {
  margin-top: auto;
}

.button {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 18px;
  min-height: 56px;
  padding: 0.95rem 1rem;
  font-family: "Sora", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.button--primary {
  color: #03121d;
  min-height: 86px;
  font-size: 1.45rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.45), transparent 36%),
    linear-gradient(135deg, #7df9ff, #97f5e7 55%, #c3fff6);
  box-shadow:
    0 16px 50px rgba(125, 249, 255, 0.26),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.button--secondary {
  color: var(--text);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.55), rgba(99, 102, 241, 0.45));
}

.button--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.signal-card,
.mini-card,
.note-card,
.ops-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
}

.signal-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 1rem 1.05rem;
}

.signal-card strong,
.mini-card strong {
  display: block;
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.signal-card__label,
.mini-card__label,
.note-card__label,
.ops-card__eyebrow,
.handoff-card__label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.mini-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.mini-card,
.note-card {
  padding: 1rem;
}

.transcript-feed {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(4, 7, 15, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.transcript-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.transcript-message {
  display: flex;
  gap: 0.75rem;
}

.transcript-message--user {
  flex-direction: row-reverse;
}

.transcript-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.transcript-message--assistant .transcript-avatar {
  background: rgba(125, 249, 255, 0.16);
  color: var(--cyan);
}

.transcript-message--user .transcript-avatar {
  background: rgba(73, 242, 172, 0.14);
  color: var(--emerald);
}

.transcript-bubble {
  max-width: min(72%, 34rem);
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.transcript-message--assistant .transcript-bubble {
  border-top-left-radius: 8px;
}

.transcript-message--user .transcript-bubble {
  border-top-right-radius: 8px;
  background: rgba(73, 242, 172, 0.08);
}

.transcript-role {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}

.ops-panel {
  overflow: auto;
}

.ops-panel::-webkit-scrollbar,
.transcript-feed::-webkit-scrollbar {
  width: 10px;
}

.ops-panel::-webkit-scrollbar-thumb,
.transcript-feed::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.ops-card {
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
}

.ops-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(125, 249, 255, 0.12);
  border: 1px solid rgba(125, 249, 255, 0.2);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 700;
}

.pill--subtle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.76);
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.detail-list dt {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.detail-list dd {
  line-height: 1.45;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 0.85rem;
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.timeline__status.is-done {
  background: rgba(73, 242, 172, 0.14);
  color: var(--emerald);
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: 0;
}

.timeline__status.is-live {
  background: rgba(255, 203, 115, 0.14);
  color: var(--amber);
}

.handoff-card {
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.handoff-card strong {
  display: block;
  letter-spacing: -0.03em;
}

@keyframes floatA {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(72px, -34px, 0);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-82px, 56px, 0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(125, 249, 255, 0.35);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(125, 249, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(125, 249, 255, 0);
  }
}

@media (max-width: 1200px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .demo-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .transcript-feed,
  .ops-panel {
    min-height: 24rem;
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .topbar__brand {
    justify-items: start;
  }

  .control-panel__actions,
  .signal-card,
  .mini-grid,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .button--primary {
    min-height: 74px;
    font-size: 1.2rem;
  }

  .timeline li {
    grid-template-columns: 1fr;
  }

  .transcript-bubble {
    max-width: 100%;
  }
}
