:root {
  --brand-primary: #0f75bc;
  --brand-green: #8cc63f;
  --ink: #0f172a;
  --bg-a: #e8f3fb;
  --bg-b: #f7ffef;
  --panel: #ffffffee;
  --line: #d1e4f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 14%, #cbe8fb 0%, transparent 35%),
    radial-gradient(circle at 88% 12%, #dff3be 0%, transparent 36%),
    linear-gradient(140deg, var(--bg-a), var(--bg-b));
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  padding: 1.2rem 1.2rem 320px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

h1 {
  margin: 0.3rem 0 0;
  font-size: clamp(1.4rem, 2.4vw, 2.1rem);
}

.layout-control {
  display: grid;
  gap: 0.35rem;
}

.layout-control label {
  font-size: 0.85rem;
  color: #315b7b;
}

.layout-control select {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  text-align: center;
  font-weight: 600;
  opacity: 0.55;
  transition: 220ms ease;
}

.step.active {
  opacity: 1;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px #0f75bc1f inset;
}

.content {
  min-height: 42vh;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
}

.placeholder {
  color: #4f6375;
}

.results-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
  color: #2b4f67;
}

.results-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.9rem;
}

.results-layout-list {
  display: grid;
  gap: 0.8rem;
}

.property-card {
  background: #fff;
  border: 1px solid #dcecf9;
  border-radius: 14px;
  padding: 0.85rem;
  display: grid;
  gap: 0.55rem;
}

.property-card .price {
  font-weight: 700;
  color: var(--brand-primary);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid #dcecf9;
  padding: 0.2rem 0.55rem;
  color: #36566d;
}

.map-placeholder {
  border: 1px dashed #b8d7ee;
  border-radius: 14px;
  background: repeating-linear-gradient(
    -45deg,
    #f1f8fd,
    #f1f8fd 10px,
    #edf6e3 10px,
    #edf6e3 20px
  );
  min-height: 240px;
  display: grid;
  place-items: center;
  color: #2e5d80;
  font-weight: 600;
}

.voice-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 300px;
  background: linear-gradient(180deg, #f9fdffec 0%, #eef7ff 45%, #e9f4ea 100%);
  border-top: 1px solid #cfe3f4;
  backdrop-filter: blur(8px);
}

.voice-dock-inner {
  height: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.orb-wrap {
  position: relative;
  width: 90px;
  height: 90px;
}

.orb {
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #6db7e6, #0f75bc 55%, #0b5f98 100%);
  box-shadow: 0 10px 32px #0f75bc55;
  transform-origin: center;
}

.orb-ring {
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  border: 2px solid #0f75bc57;
  animation: pulse 2.3s infinite;
}

.assistant-state {
  font-size: 1.2rem;
  font-weight: 700;
}

.transcript {
  margin-top: 0.5rem;
  color: #35566d;
  max-width: 70ch;
  line-height: 1.4;
}

.debug-panel {
  margin-top: 0.85rem;
  max-width: 70ch;
}

.debug-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #45657d;
  margin-bottom: 0.3rem;
}

.debug-log {
  margin: 0;
  min-height: 88px;
  max-height: 110px;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid #cfe3f4;
  background: #f8fcff;
  color: #27475f;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.dock-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn {
  border: 1px solid #bdd8ee;
  background: #fff;
  color: #194766;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  border-color: var(--brand-primary);
  background: linear-gradient(120deg, var(--brand-primary), #4d98ce);
  color: #fff;
}

[data-app-state='listening'] .orb {
  animation: listening 1.2s infinite ease-in-out;
}

[data-app-state='thinking'] .orb {
  animation: thinking 1s infinite linear;
}

[data-app-state='rendering'] .orb {
  animation: rendering 0.6s infinite ease-in-out;
}

[data-app-state='rendering'] .orb-ring {
  border-color: #8cc63fb5;
}

[data-app-state='muted'] .orb {
  filter: grayscale(0.7);
  opacity: 0.75;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.72; }
  70% { transform: scale(1.05); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.72; }
}

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

@keyframes thinking {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(0.95); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes rendering {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.08) translateY(-2px); }
}

@media (max-width: 840px) {
  .app-shell {
    padding-bottom: 320px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .voice-dock-inner {
    grid-template-columns: 80px 1fr;
  }

  .dock-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .orb,
  .orb-wrap {
    width: 76px;
    height: 76px;
  }
}
