:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #fff5f1;
  --primary: #ff6b35;
  --primary-deep: #e55521;
  --navy: #0f1f35;
  --navy-soft: #5a6a7f;
  --border: #dbe4ef;
  --shadow: 0 18px 46px rgba(15, 31, 53, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--navy);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 53, 0.12), transparent 22%),
    radial-gradient(circle at top right, rgba(15, 31, 53, 0.08), transparent 18%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  font-family: inherit;
}

.app-shell {
  width: min(1320px, 100%);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #ff956c);
  color: #fff;
  font-weight: 800;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
}

.brand-tag {
  font-size: 0.86rem;
  color: var(--navy-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.site-nav-link {
  padding: 11px 16px;
  border-radius: 999px;
  color: var(--navy-soft);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav-link:hover,
.site-nav-link.is-active {
  color: #fff;
  background: var(--navy);
}

.layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.chat-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px 24px max(130px, calc(130px + env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.message.user {
  justify-content: flex-end;
}

.message.user .message-avatar {
  order: 2;
  background: linear-gradient(135deg, var(--navy), #27405f);
}

.message.user .message-bubble {
  order: 1;
  background: var(--navy);
  color: #fff;
  border-top-right-radius: 8px;
}

.message-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #ff9b73);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.message-bubble {
  max-width: min(720px, 100%);
  padding: 15px 17px;
  border-radius: 18px 18px 18px 8px;
  background: #fff;
  border: 1px solid var(--border);
  white-space: pre-line;
}

.message-bubble p {
  margin: 0;
}

.results-message {
  width: 100%;
}

.results-message .message-bubble {
  max-width: min(960px, 100%);
  padding: 12px 0 0;
  background: transparent;
  border: 0;
}

.composer {
  background: #fff;
}

.chat-input-wrapper {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(calc(100% - 48px), 1272px);
  z-index: 1000;
  padding: 20px 22px max(20px, env(safe-area-inset-bottom));
  border: 1px solid rgba(219, 228, 239, 0.95);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 34px rgba(15, 31, 53, 0.1);
  box-sizing: border-box;
}

.composer-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 130px auto;
  gap: 12px;
  align-items: center;
}

.icon-button {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.icon-button:hover:not(:disabled),
.mini-action-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.icon-button:disabled,
.mini-action-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mic-button {
  background: linear-gradient(135deg, var(--surface-soft), #fff);
  color: var(--primary-deep);
  border: 1px solid rgba(255, 107, 53, 0.18);
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.12);
}

.mic-button.is-recording {
  background: linear-gradient(135deg, var(--primary), #ff9467);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.35), 0 16px 28px rgba(255, 107, 53, 0.28);
  animation: micPulse 1.35s infinite;
}

.send-button {
  background: linear-gradient(135deg, var(--navy), #28425f);
  color: #fff;
  box-shadow: 0 14px 24px rgba(15, 31, 53, 0.24);
}

.input-shell {
  position: relative;
  min-height: 56px;
}

.message-input,
.voice-panel,
.language-select {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  border-radius: 16px;
  min-height: 56px;
}

.message-input,
.voice-panel {
  width: 100%;
}

.message-input {
  padding: 0 16px;
}

.message-input:focus,
.language-select:focus {
  outline: none;
  border-color: rgba(255, 107, 53, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.language-select {
  padding: 0 16px;
}

.voice-panel {
  display: none;
  position: absolute;
  inset: 0;
  padding: 8px 14px;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 245, 241, 0.95), rgba(255, 255, 255, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.08);
}

.voice-panel.is-visible {
  display: flex;
}

.voice-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-width: 92px;
  height: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 107, 53, 0.08);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.12);
  flex: 0 0 auto;
}

.voice-bar {
  width: 3px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff9b73, var(--primary));
  transform-origin: center bottom;
  animation: wave 1s ease-in-out infinite;
}

.voice-bar:nth-child(2n) {
  animation-duration: 1.2s;
}

.voice-bar:nth-child(3n) {
  animation-duration: 0.8s;
}

.voice-bar:nth-child(4n) {
  animation-delay: 0.15s;
}

.voice-bar:nth-child(5n) {
  animation-delay: 0.25s;
}

.voice-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.voice-status {
  color: var(--primary-deep);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
}

.voice-transcript {
  display: block;
  color: var(--navy-soft);
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mini-action-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 8px 18px rgba(15, 31, 53, 0.08);
}

.mini-action-button.is-visible {
  display: inline-flex;
}

.mini-action-button:hover:not(:disabled) {
  border-color: rgba(255, 107, 53, 0.32);
  box-shadow: 0 10px 18px rgba(255, 107, 53, 0.12);
}

.property-results {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.property-results-summary {
  margin: 0 0 4px;
  color: var(--navy-soft);
  font-size: 0.96rem;
  font-weight: 600;
}

.property-card {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 31, 53, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(15, 31, 53, 0.12);
}

.property-image-wrap {
  position: relative;
  aspect-ratio: 16 / 7.5;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.14), rgba(15, 31, 53, 0.08));
}

.property-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.property-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 31, 53, 0.82);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.property-body {
  padding: 14px 14px 16px;
}

.property-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.property-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.property-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f6f9fc;
  color: #37506c;
  font-size: 0.78rem;
  font-weight: 700;
}

.property-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-location {
  margin: 0 0 10px;
  color: var(--navy-soft);
  font-size: 0.9rem;
  line-height: 1.35;
}

.property-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}

.property-type {
  color: #234fcd;
}

.property-bhk {
  color: #1b6e44;
}

.property-area {
  color: #6c4c1f;
}

.property-furnishing {
  color: var(--navy-soft);
  font-weight: 600;
}

.property-secondary-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.property-id {
  color: var(--navy-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.property-price {
  color: #ff6a57;
  font-size: 0.95rem;
  font-weight: 800;
}

.property-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f6f9fc;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.78rem;
}

@keyframes micPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.35), 0 16px 28px rgba(255, 107, 53, 0.28);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 0 10px rgba(255, 107, 53, 0), 0 20px 30px rgba(255, 107, 53, 0.3);
  }
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.45);
    opacity: 0.65;
  }
  50% {
    transform: scaleY(1.5);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .chat-panel { min-height: 0; }
}

@media (max-width: 860px) {
  .composer-row {
    grid-template-columns: 52px minmax(0, 1fr) 112px auto;
  }
}


@media (max-width: 768px) {
  .chat-input-wrapper {
    width: 100%;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .messages {
    padding-bottom: max(150px, calc(150px + env(safe-area-inset-bottom)));
  }
}
@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

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

  .site-nav { align-self: center; }

  .composer-row {
    grid-template-columns: 48px minmax(0, 1fr) 96px auto;
    gap: 8px;
  }

  .icon-button {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 0.82rem;
  }

  .message-input,
  .voice-panel,
  .language-select,
  .input-shell {
    min-height: 48px;
  }

  .voice-panel {
    padding: 7px 10px;
    gap: 8px;
  }

  .voice-wave {
    min-width: 72px;
    gap: 2px;
  }

  .voice-copy {
    gap: 1px;
  }

  .voice-status {
    font-size: 0.76rem;
  }

  .voice-transcript {
    font-size: 0.74rem;
  }

  .mini-action-button {
    width: 36px;
    height: 36px;
  }

  .results-message .message-bubble {
    max-width: 100%;
  }

  .property-results {
    grid-template-columns: 1fr;
  }

  .property-title {
    font-size: 1rem;
  }

  .property-location {
    font-size: 0.88rem;
  }

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