﻿:root {
  --ink: #17211d;
  --muted: #65716c;
  --line: #dfe5e1;
  --surface: #ffffff;
  --soft: #f3f6f4;
  --green: #076652;
  --green-dark: #003d34;
  --green-deep: #002f29;
  --gold: #c9973b;
  --danger: #a23b3b;
}

.home-link {
  color: inherit;
  text-decoration: none;
}

.home-link:focus-visible {
  outline: 2px solid #0b6b5a;
  outline-offset: 4px;
  border-radius: 4px;
}

@media (max-width: 760px) {
  input,
  textarea,
  select,
  .inline-query-input,
  .composer-box textarea,
  .hero-search input {
    font-size: 16px !important;
  }

  .workspace,
  .chat,
  .message-content,
  .inline-query-form,
  .composer,
  .composer-box {
    min-width: 0;
    max-width: 100%;
  }

  .composer-box,
  .inline-query-form {
    overflow: hidden;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #f5f7f6;
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--surface);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px 20px;
  overflow: hidden;
  background: var(--green-deep);
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 7px 30px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #a7bbb3;
  font-size: 11px;
}

.new-chat {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  margin-bottom: 26px;
  padding: 0 16px;
  border: 1px solid #42665d;
  border-radius: 8px;
  background: transparent;
  color: white;
  text-align: left;
}

.new-chat:hover {
  background: #0d5145;
  border-color: #5d8077;
}

.history-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 120px;
  margin-bottom: 18px;
  overflow: hidden;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
}

.history-title {
  padding: 0 12px;
  color: #8ea79d;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.history-toggle {
  padding: 4px 8px;
  border: 0;
  background: none;
  color: #c9973b;
  font-size: 10px;
}

.history-toggle:hover {
  color: #efc66d;
}

.history-search {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  margin: 5px 0 7px;
  padding: 0 10px;
  border: 1px solid #31584e;
  border-radius: 6px;
  background: #073f36;
}

.history-search:focus-within {
  border-color: #71988e;
}

.history-search svg {
  width: 17px;
  height: 17px;
  color: #91aba2;
}

.history-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  font-size: 13px;
}

.history-search input::placeholder {
  color: #78968c;
}

.history-search input::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: .6;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #52786e transparent;
}

.history-list::-webkit-scrollbar {
  width: 5px;
}

.history-list::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: #52786e;
}

.history-empty {
  margin: 10px 12px;
  color: #8ea79d;
  font-size: 10px;
  line-height: 1.5;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
}

.history-item {
  width: 100%;
  overflow: hidden;
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #bfd0ca;
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item:hover,
.history-item.active {
  background: #0b5b4c;
  color: white;
}

.history-delete {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #78968c;
  opacity: .7;
}

.history-row:hover .history-delete,
.history-delete:focus-visible {
  opacity: 1;
}

.history-delete:hover {
  background: #75423d;
  color: white;
}

.history-delete svg {
  width: 16px;
  height: 16px;
}

nav {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
}

.nav-item {
  display: flex;
  gap: 13px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c6d5d0;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #0d6656;
  color: white;
}

.sidebar-footer {
  display: flex;
  gap: 9px;
  align-items: center;
  flex: 0 0 auto;
  margin-top: auto;
  padding: 17px 10px 0;
  border-top: 1px solid #31554c;
  color: #aec1ba;
  font-size: 11px;
}

.sidebar-footer svg {
  color: #70c894;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 10px 28px;
  border-bottom: 1px solid #edf0ee;
  background: white;
}

.chat-heading h1 {
  margin: 0;
  font: 600 18px "Playfair Display", Georgia, serif;
}

.chat-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.app-shell:not(.chat-mode) .chat-heading {
  visibility: hidden;
}

.profile-button {
  margin-left: auto;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #ccd5d1;
  border-radius: 7px;
  background: white;
  color: var(--ink);
}

.icon-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.menu-button {
  display: none;
  margin-right: 12px;
}

.dashboard {
  overflow-y: auto;
  padding: 0 22px 24px;
}

.hero-panel {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border-radius: 8px;
  background-image:
    linear-gradient(90deg, rgba(0, 50, 42, .97) 0%, rgba(0, 50, 42, .86) 34%, rgba(0, 50, 42, .22) 63%, rgba(0, 0, 0, .05) 100%),
    url("assets/khp-hero-city.png");
  background-position: center;
  background-size: cover;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 390px;
  width: min(650px, 58%);
  padding: 30px 54px;
  color: white;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  color: white;
}

.hero-brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.hero-brand strong {
  font-size: 14px;
}

.hero-content h1 {
  margin: 0;
  max-width: 560px;
  font-size: 38px;
  line-height: 1.25;
}

.hero-content h1 span {
  display: block;
  color: var(--gold);
}

.hero-content>p {
  margin: 11px 0 20px;
  color: #d7e3df;
  font-size: 14px;
}

.hero-search {
  display: flex;
  width: 100%;
  max-width: 610px;
  min-height: 58px;
  padding: 6px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .15);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.hero-search button {
  display: grid;
  place-items: center;
  flex: 0 0 47px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: white;
}

.hero-stats {
  display: flex;
  margin-top: 20px;
}

.hero-stats>div {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 0 20px;
  border-left: 1px solid rgba(255, 255, 255, .22);
}

.hero-stats>div:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-stats svg {
  flex: 0 0 auto;
  color: var(--gold);
}

.hero-stats span {
  color: #cbdad5;
  font-size: 10px;
  line-height: 1.35;
}

.hero-stats strong {
  display: block;
  color: var(--gold);
  font-size: 14px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.action-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.action-card:hover {
  border-color: #9dbdb3;
  box-shadow: 0 8px 24px rgba(20, 54, 43, .07);
}

.action-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green);
}

.action-icon svg {
  width: 25px;
  height: 25px;
}

.action-card strong {
  font-size: 15px;
}

.action-card small {
  margin-top: 8px;
  max-width: 220px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.action-arrow {
  position: absolute;
  right: 20px;
  bottom: 22px;
  color: var(--gold);
}

.dashboard-lower {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 16px;
  margin-top: 16px;
}

.suggestion-panel,
.featured-panel {
  min-height: 178px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.suggestion-panel h2,
.featured-panel h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  font-size: 13px;
}

.suggestion-panel h2 svg {
  color: var(--gold);
}

.featured-panel h2 svg {
  color: var(--green);
}

.suggestion-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.suggestion-pills button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: #275e51;
  font-size: 11px;
  text-align: left;
}

.suggestion-pills button:hover {
  border-color: var(--green);
  background: #f7faf8;
}

.suggestion-pills svg {
  width: 15px;
  height: 15px;
}

.featured-content {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.featured-content img {
  width: 190px;
  height: 100px;
  object-fit: cover;
  border-radius: 7px;
}

.featured-content strong,
.featured-content span {
  display: block;
}

.featured-content strong {
  font-size: 13px;
}

.featured-content span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.featured-content b {
  color: var(--gold);
}

.featured-content button {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.featured-content button svg {
  width: 15px;
  height: 15px;
}

.chat {
  overflow-y: auto;
  padding: 28px 24px;
}

.message {
  display: flex;
  gap: 10px;
  max-width: 900px;
  margin: 0 auto 20px;
}

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

.avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--green);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble {
  max-width: min(720px, 84%);
  padding: 13px 16px;
  border-radius: 7px;
  background: var(--soft);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-line;
}

.user .bubble {
  background: var(--green);
  color: white;
}

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

.property-card {
  overflow: hidden;
  padding: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.property-media {
  aspect-ratio: 16 / 9;
  margin: 0 -14px 13px;
  overflow: hidden;
  background: var(--soft);
}

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

.property-card strong {
  display: block;
  color: var(--green-dark);
}

.property-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.property-card b {
  display: block;
  margin-top: 9px;
  color: var(--gold);
}

.property-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.property-actions button {
  padding: 8px 11px;
  border: 1px solid var(--green);
  border-radius: 5px;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.property-actions a {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.quick-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.quick-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #cfddd7;
  border-radius: 6px;
  background: white;
  color: var(--green-dark);
  font-size: 10px;
  text-align: left;
}

.quick-options button:hover {
  border-color: var(--green);
  background: #f8fbfa;
}

.quick-options button.selected {
  border-color: var(--green);
  background: #edf6f2;
  font-weight: 700;
}

.quick-options.resolved button:disabled {
  cursor: default;
  opacity: .48;
}

.quick-options.resolved button.selected {
  opacity: 1;
}

.quick-options svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.inline-query-form {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  padding: 6px;
  border: 1px solid #bdd0c8;
  border-radius: 6px;
  background: white;
}

.inline-query-input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 11px;
}

.inline-query-form>button {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: white;
}

.inline-query-form>button svg {
  width: 17px;
  height: 17px;
}

.inline-query-form :disabled {
  cursor: default;
  opacity: .55;
}

.conversation-wizard {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #c9d8d2;
  border-radius: 7px;
  background: #fff;
}

.wizard-heading {
  display: grid;
  gap: 9px;
}

.wizard-heading>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wizard-heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.wizard-heading strong {
  color: var(--green-dark);
  font-size: 12px;
}

.wizard-heading progress {
  width: 100%;
  height: 5px;
  border: 0;
  accent-color: var(--green);
}

.conversation-wizard>p {
  margin: 13px 0 10px;
  font-weight: 600;
}

.wizard-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wizard-options button,
.wizard-confirmed button,
.wizard-actions button {
  border: 1px solid #cfddd7;
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
}

.wizard-options button {
  min-height: 40px;
  padding: 9px 10px;
  font-size: 10px;
}

.wizard-options button:hover,
.wizard-options button.selected {
  border-color: var(--green);
  background: #edf6f2;
}

.wizard-confirmed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
}

.wizard-confirmed>span {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
}

.wizard-confirmed button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  font-size: 9px;
}

.wizard-confirmed svg {
  width: 12px;
  height: 12px;
}

.wizard-custom-form {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.wizard-custom-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #cfddd7;
  border-radius: 6px;
  outline: 0;
}

.wizard-custom-form input:focus {
  border-color: var(--green);
}

.wizard-custom-form button {
  display: grid;
  place-items: center;
  width: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
}

.wizard-custom-form svg {
  width: 16px;
  height: 16px;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.wizard-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 9px;
  font-size: 9px;
}

.wizard-actions svg {
  width: 13px;
  height: 13px;
}

.conversation-wizard :disabled {
  cursor: default;
  opacity: .5;
}

.loan-asset {
  padding: 11px;
  border: 1px solid #cfddd7;
  border-radius: 6px;
  background: #f7faf9;
}

.loan-asset span,
.loan-asset small {
  display: block;
  color: var(--muted);
}

.loan-asset strong {
  display: block;
  margin: 4px 0;
  color: var(--green-dark);
}

.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  max-width: calc(100% - 52px);
  height: 40px;
  padding: 0 14px;
}

.loading-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: .14s;
}

.typing-dot:nth-child(3) {
  animation-delay: .28s;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #dfe6e2;
}

.feedback-actions button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #66756f;
  cursor: pointer;
}

.feedback-actions button:hover,
.feedback-actions button.selected {
  color: #08745b;
  background: #e8f3ef;
}

.feedback-actions button:disabled {
  cursor: default;
  opacity: .65;
}

.feedback-actions svg {
  width: 16px;
  height: 16px;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: .45;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.composer {
  padding: 12px 24px 15px;
  border-top: 1px solid var(--line);
  background: white;
}

.composer-box {
  display: flex;
  max-width: 900px;
  margin: auto;
  padding: 7px;
  border: 1px solid #bdc8c2;
  border-radius: 7px;
  background: white;
}

textarea {
  flex: 1;
  max-height: 110px;
  padding: 9px 10px;
  resize: none;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.send-button {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 5px;
  background: var(--green);
  color: white;
}

.composer>small {
  display: block;
  max-width: 900px;
  margin: 7px auto 0;
  color: #89918d;
  text-align: center;
  font-size: 9px;
}

dialog {
  width: min(580px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .22);
}

dialog::backdrop {
  background: rgba(9, 26, 20, .55);
}

.delete-dialog {
  width: min(410px, calc(100% - 32px));
  border-radius: 5px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .2);
}

.delete-dialog::backdrop {
  background: rgba(24, 28, 26, .58);
}

.delete-dialog-card {
  display: grid;
  justify-items: center;
  padding: 32px 34px 20px;
  text-align: center;
}

.delete-dialog-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin-bottom: 22px;
  border: 3px solid #d7a248;
  border-radius: 50%;
  color: #d7a248;
}

.delete-dialog-icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 1.5;
}

.delete-dialog-card h2 {
  margin: 0;
  color: #3d403e;
  font-size: 23px;
  font-weight: 700;
}

.delete-dialog-card p {
  margin: 12px 0 24px;
  color: #717773;
  font-size: 14px;
}

.delete-dialog-actions {
  display: flex;
  gap: 8px;
}

.delete-dialog-actions button {
  min-width: 52px;
  min-height: 34px;
  padding: 8px 14px;
  border: 0;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
}

.delete-cancel {
  background: #9da19f;
}

.delete-confirm {
  background: var(--green);
}

.delete-confirm:hover {
  background: var(--green-dark);
}

.delete-cancel:hover {
  background: #858a87;
}

.dialog-card {
  max-height: calc(100dvh - 28px);
  padding: 22px;
  overflow-y: auto;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 19px;
}

.dialog-header h2 {
  margin: 3px 0 0;
  font: 600 24px "Playfair Display", Georgia, serif;
}

.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.profile-summary {
  padding: 12px;
  border: 1px solid #cfddd7;
  border-radius: 6px;
  background: #f7faf9;
}

.profile-summary span,
.profile-summary small {
  display: block;
  color: var(--muted);
}

.profile-summary strong {
  display: block;
  margin: 4px 0;
  color: var(--green-dark);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
}

.field input:focus,
.field select:focus {
  border-color: var(--green);
}

.loan-principal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--soft);
}

.loan-principal.full,
.form-error.full {
  grid-column: 1 / -1;
}

.loan-principal span {
  color: var(--muted);
  font-size: 11px;
}

.loan-principal strong {
  color: var(--green);
  font-size: 15px;
}

.form-error {
  margin: -3px 0 0;
  color: var(--danger);
  font-size: 11px;
}

.loan-result {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #bad0c8;
  border-radius: 7px;
  background: #f6faf8;
}

.loan-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.loan-result-heading span {
  font-size: 14px;
  font-weight: 700;
}

.loan-result-heading strong {
  color: var(--green);
  font-size: 11px;
}

.loan-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.loan-result-grid div {
  padding: 10px;
  border: 1px solid #dce7e2;
  border-radius: 5px;
  background: white;
}

.loan-result-grid span,
.loan-result-grid strong {
  display: block;
}

.loan-result-grid span {
  color: var(--muted);
  font-size: 10px;
}

.loan-result-grid strong {
  margin-top: 4px;
  color: var(--green-dark);
  font-size: 12px;
}

.loan-result>p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.dialog-actions button {
  padding: 10px 16px;
  border-radius: 5px;
}

.secondary {
  border: 1px solid var(--line);
  background: white;
}

.primary {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.embed body {
  background: white;
}

.embed .app-shell {
  grid-template-columns: 1fr;
  width: 100%;
  height: 100vh;
  box-shadow: none;
}

.embed .sidebar {
  display: none;
}

.embed .topbar {
  min-height: 60px;
  padding: 9px 13px;
}

.embed .chat-heading {
  visibility: visible !important;
}

.embed .dashboard {
  padding: 0 10px 14px;
}

.embed .hero-panel,
.embed .hero-content {
  min-height: 420px;
}

.embed .hero-content {
  width: 100%;
  padding: 24px;
}

.embed .hero-content h1 {
  font-size: 29px;
}

.embed .hero-stats,
.embed .dashboard-lower {
  display: none;
}

.embed .quick-actions {
  grid-template-columns: 1fr 1fr;
}

.embed .action-card {
  min-height: 145px;
  padding: 16px;
}

.embed .action-icon {
  margin-bottom: 12px;
}

.embed .chat {
  padding: 18px 14px;
}

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

.embed .bubble {
  max-width: calc(100% - 42px);
}

.embed .composer {
  padding: 10px 12px 12px;
}

@media (max-width: 1120px) {
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content {
    width: 68%;
  }

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

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    width: min(290px, calc(100vw - 24px));
    transform: translateX(-100%);
    transition: transform .2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-button {
    display: grid;
  }

  .app-shell:not(.chat-mode) .chat-heading {
    visibility: visible;
  }

  .topbar {
    min-height: 62px;
    padding: 9px 13px;
  }

  .dashboard {
    padding: 0 10px 14px;
  }

  .hero-panel {
    min-height: 450px;
    background-position: 62% center;
  }

  .hero-content {
    justify-content: flex-end;
    width: 100%;
    min-height: 450px;
    padding: 24px 20px;
  }

  .hero-brand {
    margin-bottom: 18px;
  }

  .hero-content h1 {
    font-size: 30px;
  }

  .hero-content>p {
    font-size: 12px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .hero-stats>div {
    padding: 0;
    border: 0;
  }

  .hero-stats>div:last-child {
    display: none;
  }

  .quick-actions {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
  }

  .action-card {
    min-height: 120px;
    padding: 16px;
  }

  .action-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
  }

  .action-card small {
    display: none;
  }

  .dashboard-lower {
    gap: 10px;
    margin-top: 10px;
  }

  .suggestion-pills {
    grid-template-columns: 1fr;
  }

  .featured-content {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .featured-content img {
    width: 110px;
    height: 100px;
  }

  .chat {
    padding: 20px 12px;
  }

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

  .quick-options {
    grid-template-columns: 1fr 1fr;
  }

  .wizard-options {
    grid-template-columns: 1fr;
  }

  .composer {
    padding: 10px 12px 12px;
  }

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

  .field.full {
    grid-column: auto;
  }

  .loan-principal.full,
  .form-error.full {
    grid-column: auto;
  }

  .loan-result-grid {
    grid-template-columns: 1fr;
  }

  .dialog-card {
    padding: 18px;
  }
}

@media (max-width: 420px) {
  .hero-search {
    min-height: 52px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stats>div:nth-child(2) {
    display: none;
  }
}

/* KHP Land conversational workspace */
body {
  min-height: 100vh;
  padding: 24px;
  background: #f2f4f2;
}

.app-shell {
  grid-template-columns: 344px minmax(0, 1fr);
  width: min(1540px, 100%);
  height: calc(100vh - 48px);
  min-height: 680px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #e4e8e5;
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(25, 46, 39, .14);
}

.sidebar {
  position: relative;
  height: 100%;
  padding: 30px 26px 24px;
  background: #003f35;
}

.brand {
  gap: 12px;
  padding: 0 0 30px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
  border: 1px solid rgba(216, 166, 70, .55);
}

.brand strong {
  color: #e2ae4d;
  font-size: 20px;
  font-weight: 700;
}

.brand span {
  color: #e0ebe6;
  font-size: 12px;
}

.new-chat {
  justify-content: center;
  min-height: 54px;
  margin-bottom: 14px;
  border: 0;
  background: #d6a445;
  color: #fff;
  font-weight: 700;
}

.new-chat:hover {
  border-color: transparent;
  background: #c18c2f;
}

.history-panel {
  margin: 0;
}

.history-search {
  min-height: 46px;
  margin: 0 0 24px;
  padding: 0 14px;
  border-color: #3b6f63;
  background: #073f36;
}

.history-title {
  padding: 0;
  color: #e9f0ed;
  font-size: 11px;
}

.history-list {
  margin-top: 8px;
}

.history-row {
  border-bottom: 1px solid rgba(226, 237, 232, .14);
}

.history-item {
  min-height: 58px;
  padding: 10px 8px;
  color: #eef5f2;
}

.history-item:hover,
.history-item.active {
  background: rgba(255, 255, 255, .08);
}

.sidebar-tools {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.sidebar-tools .nav-item {
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid #3a6c61;
  font-size: 11px;
}

.sidebar-tools .nav-item svg {
  width: 17px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  margin-top: 18px;
  padding: 18px 14px;
  border: 1px solid rgba(220, 174, 85, .25);
  border-radius: 8px;
  background: #145448;
  color: white;
  text-align: center;
}

.sidebar-footer strong {
  font-size: 12px;
  line-height: 1.5;
}

.sidebar-footer > span {
  color: #c9dbd4;
  font-size: 9px;
}

.sidebar-footer small {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #e0ad4b;
  font-size: 9px;
}

.sidebar-footer svg {
  width: 13px;
  height: 13px;
  color: #e0ad4b;
}

.workspace {
  height: 100%;
  background: #fff;
}

.app-shell:not(.chat-mode) .topbar {
  display: none;
}

.app-shell:not(.chat-mode) .workspace {
  grid-template-rows: minmax(0, 1fr);
}

.topbar {
  min-height: 68px;
  padding: 10px 34px;
}

.dashboard {
  display: grid;
  place-items: stretch;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.welcome-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 38px 48px 24px;
  overflow-y: auto;
  background: #fff;
}

.welcome-panel > * {
  position: relative;
  z-index: 1;
}

.welcome-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #c28f32;
  font-size: 15px;
}

.welcome-brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.welcome-panel h1 {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 24px 0 6px;
  color: #063f34;
  font-size: 29px;
  line-height: 1.25;
  text-align: center;
}

.welcome-panel h1 svg {
  color: #d5a03c;
}

.welcome-panel > p {
  margin: 0;
  color: #65716c;
  font-size: 13px;
  text-align: center;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin: 24px 0 30px;
}

.action-card {
  display: flex;
  gap: 10px;
  align-items: center;
  width: auto;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid #dce2df;
  border-radius: 8px;
  background: #fff;
  color: #173f36;
  box-shadow: 0 3px 10px rgba(19, 56, 46, .04);
}

.action-card:hover {
  transform: none;
  border-color: #cfa04a;
  box-shadow: 0 5px 14px rgba(19, 56, 46, .08);
}

.action-card svg {
  width: 19px;
  height: 19px;
  color: #d09a38;
}

.action-card span {
  font-size: 12px;
  font-weight: 600;
}

.welcome-message {
  display: flex;
  gap: 14px;
  align-self: flex-start;
  width: min(720px, 82%);
  margin: 0 0 auto;
}

.welcome-message .avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  margin-top: 6px;
}

.welcome-message .bubble {
  max-width: 100%;
  padding: 14px 18px;
  border: 1px solid #dce2df;
  background: #fff;
  box-shadow: 0 4px 12px rgba(19, 56, 46, .04);
  color: #1f2926;
}

.hero-search {
  display: flex;
  align-items: center;
  width: min(980px, 100%);
  min-height: 58px;
  margin: 34px auto 0;
  padding: 7px;
  border: 1px solid #d5ddda;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(14, 48, 39, .08);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  outline: 0;
  color: #1b2824;
}

.hero-search > button:last-child {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 7px;
  background: #00483d;
  color: #fff;
}

.composer-tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 0;
  background: transparent;
  color: #24594d;
}

.trust-note {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  color: #8b9490;
  font-size: 9px;
}

.trust-note svg {
  width: 13px;
  height: 13px;
}

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

.chat {
  padding: 30px 36px;
  background: #fff;
}

.message {
  max-width: 1040px;
}

.message .bubble {
  border: 1px solid #dce2df;
  background: #fff;
}

.message.user .bubble {
  border-color: #d5e3dd;
  background: #edf4f1;
  color: #193c34;
}

.composer {
  padding: 12px 34px 16px;
  border-top: 0;
}

.composer-box {
  max-width: 1040px;
  min-height: 56px;
  align-items: center;
  border-color: #d2dbd7;
  box-shadow: 0 5px 16px rgba(14, 48, 39, .07);
}

@media (max-width: 980px) {
  body {
    padding: 0;
  }

  .app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .sidebar {
    padding: 24px 18px;
  }

  .welcome-panel {
    padding: 32px 24px 20px;
  }

  .quick-actions {
    gap: 8px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    height: 100vh;
  }

  .workspace {
    grid-row: 1;
    grid-column: 1;
    height: 100vh;
  }

  .app-shell:not(.chat-mode) .workspace {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell:not(.chat-mode) .topbar {
    display: flex;
  }

  .app-shell:not(.chat-mode) .chat-heading {
    visibility: hidden;
  }

  .dashboard {
    padding: 0;
  }

  .welcome-panel {
    justify-content: flex-start;
    padding: 24px 16px 16px;
  }

  .welcome-brand {
    margin-top: 4px;
  }

  .welcome-panel h1 {
    margin-top: 18px;
    font-size: 23px;
  }

  .quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 20px 0 26px;
  }

  .action-card {
    justify-content: flex-start;
    min-height: 54px;
    padding: 8px 11px;
  }

  .welcome-message {
    width: 100%;
  }

  .hero-search {
    margin-top: 26px;
  }

  .chat {
    padding: 20px 12px;
  }

  .composer {
    padding: 9px 12px 12px;
  }
}

@media (max-width: 420px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .welcome-panel h1 {
    font-size: 21px;
  }
}

/* Minimal assistant layout */
body {
  padding: 0;
  background: #f7f6f3;
  color: #262421;
  font-family: "Manrope", Arial, sans-serif;
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  min-height: 620px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #f7f6f3;
}

.sidebar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 42px minmax(0, 1fr) auto;
  gap: 0 8px;
  height: 100vh;
  padding: 0;
  border-right: 1px solid #dedbd5;
  background: #fbfaf7;
  color: #252320;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 0 0 12px;
}

.brand strong {
  overflow: hidden;
  color: #24221f;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-chat {
  align-self: center;
  min-height: 26px;
  width: auto;
  margin: 0 10px 0 0;
  padding: 0 11px;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: #242321;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.new-chat:hover {
  background: #0b5a4b;
}

.new-chat svg {
  width: 13px;
  height: 13px;
}

.history-panel {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  padding: 10px 8px;
  overflow: hidden;
}

.history-header {
  min-height: 24px;
}

.history-title {
  padding: 0 4px;
  color: #77726a;
  font-size: 9px;
  font-weight: 700;
}

.history-search {
  min-height: 30px;
  margin: 0 0 10px;
  padding: 0 8px;
  border: 1px solid #dedbd5;
  border-radius: 6px;
  background: #f7f6f3;
}

.history-search:focus-within {
  border-color: #9e9990;
}

.history-search svg {
  width: 13px;
  height: 13px;
  color: #8b867e;
}

.history-search input {
  color: #302e2a;
  font-size: 10px;
}

.history-search input::placeholder {
  color: #aaa69e;
}

.history-list {
  margin: 0;
}

.history-row {
  border: 0;
}

.history-item {
  min-height: 42px;
  padding: 6px 8px 6px 18px;
  border-radius: 5px;
  color: #3c3934;
  font-size: 10px;
}

.history-item::before {
  position: absolute;
  left: 7px;
  width: 5px;
  height: 5px;
  border: 1px solid #7e7971;
  border-radius: 50%;
  content: "";
}

.history-item:hover,
.history-item.active {
  background: #efede8;
  color: #0b5a4b;
}

.history-delete {
  color: #8a857d;
}

.history-empty {
  color: #8a857d;
  font-size: 10px;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  grid-column: 1 / -1;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-top: 1px solid #dedbd5;
  border-radius: 0;
  background: #fbfaf7;
  color: #24221f;
  text-align: left;
}

.account-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #c9973b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-footer > span:nth-child(2) {
  display: block;
  min-width: 0;
  color: #24221f;
}

.sidebar-footer strong {
  display: block;
  font-size: 10px;
  line-height: 1.3;
}

.sidebar-footer small {
  display: block;
  margin-top: 1px;
  color: #817c74;
  font-size: 8px;
}

.sidebar-footer > svg {
  width: 15px;
  color: #77726a;
}

.workspace {
  grid-template-rows: 42px minmax(0, 1fr) auto;
  height: 100vh;
  background: #f7f6f3;
}

.app-shell:not(.chat-mode) .workspace {
  grid-template-rows: 42px minmax(0, 1fr);
}

.app-shell:not(.chat-mode) .topbar {
  display: flex;
}

.topbar {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #dedbd5;
  background: #f7f6f3;
}

.chat-heading,
.chat-heading > div {
  display: flex;
  align-items: center;
}

.chat-heading {
  gap: 8px;
  visibility: visible !important;
}

.chat-heading > div {
  gap: 1px;
  align-items: flex-start;
  flex-direction: column;
}

.topbar-avatar {
  width: 26px;
  height: 26px;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
}

.topbar-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-heading h1 {
  font: 700 11px "Manrope", Arial, sans-serif;
}

.chat-heading p {
  display: flex;
  gap: 3px;
  align-items: center;
  margin: 0;
  color: #7a756d;
  font-size: 8px;
}

.chat-heading p svg {
  width: 9px;
  height: 9px;
  color: #c9973b;
}

.icon-button {
  width: 30px;
  height: 30px;
  border-color: #d9d5ce;
  border-radius: 6px;
  background: #fbfaf7;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.dashboard {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.welcome-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  padding: 40px 20px 150px;
  overflow-y: auto;
  background: #f7f6f3;
}

.welcome-brand {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 16px rgba(32, 29, 25, .12);
}

.welcome-brand img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.welcome-panel h1 {
  display: block;
  max-width: 680px;
  margin: 16px 0 6px;
  color: #24221f;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.welcome-panel > p {
  max-width: 560px;
  margin: 0;
  color: #77726a;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 6px;
  width: min(520px, 100%);
  margin: 22px 0 0;
}

.action-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 30px;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid #d8d4cd;
  border-radius: 16px;
  background: #fff;
  color: #35322e;
  box-shadow: none;
}

.action-card:hover {
  border-color: #0b5a4b;
  background: #f0f5f3;
  color: #0b5a4b;
  box-shadow: none;
}

.action-break {
  flex-basis: 100%;
  height: 0;
}

.action-card span {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.hero-search {
  position: absolute;
  right: 20px;
  bottom: 30px;
  left: 20px;
  display: flex;
  width: min(610px, calc(100% - 40px));
  min-height: 44px;
  margin: 0 auto;
  padding: 4px 5px;
  border: 1px solid #d7d3cc;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(31, 28, 24, .08);
}

.hero-search input {
  padding: 0 6px;
  background: transparent;
  color: #302d29;
  font-size: 11px;
}

.hero-search > button:last-child {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 50%;
  background: #006b57;
}

.hero-search > button:last-child svg {
  width: 15px;
  height: 15px;
}

.hero-search .composer-tool {
  display: grid;
  place-items: center;
  width: 24px;
  height: 30px;
  flex-basis: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: #aaa59d;
  box-shadow: none;
}

.hero-search .composer-tool:hover {
  background: transparent !important;
  color: #716c65;
}

.composer-tool svg {
  width: 14px;
  height: 14px;
}

.voice-input.listening {
  color: #a51f38;
}

.trust-note {
  position: absolute;
  bottom: 10px;
  margin: 0;
  color: #aaa59d;
  font-size: 8px;
}

.trust-note span {
  margin: 0 4px;
}

.trust-note kbd {
  padding: 1px 4px;
  border: 0;
  border-radius: 3px;
  background: #e9e6e0;
  color: #8e8981;
  font: inherit;
}

.chat {
  padding: 26px 30px;
  background: #f7f6f3;
}

.message {
  max-width: 860px;
  margin-bottom: 14px;
}

.message .bubble {
  border-color: #ddd9d2;
  background: #fff;
  color: #302d29;
  font-size: 12px;
  box-shadow: none;
}

.message.user .bubble {
  border-color: #d5e1dd;
  background: #edf3f1;
  color: #173c34;
}

.composer {
  padding: 8px 20px 12px;
  background: #f7f6f3;
}

.composer-box {
  max-width: 610px;
  min-height: 44px;
  padding: 4px 5px 4px 12px;
  border-color: #d7d3cc;
  border-radius: 24px;
  box-shadow: 0 5px 18px rgba(31, 28, 24, .08);
}

.composer-box textarea {
  padding: 7px 4px;
  font-size: 11px;
}

.send-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0b5a4b;
}

.composer > small {
  margin-top: 5px;
  color: #aaa59d;
  font-size: 8px;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(240px, calc(100vw - 48px));
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .workspace {
    grid-row: 1;
    grid-column: 1;
    height: 100vh;
  }

  .app-shell:not(.chat-mode) .workspace {
    grid-template-rows: 42px minmax(0, 1fr);
  }

  .menu-button {
    display: grid;
    margin-right: 8px;
  }

  .welcome-panel {
    justify-content: center;
    padding: 30px 16px 130px;
  }

  .welcome-brand {
    width: 62px;
    height: 62px;
  }

  .welcome-panel h1 {
    font-size: 17px;
  }

  .welcome-panel > p {
    font-size: 10px;
  }

  .quick-actions {
    display: flex;
    gap: 6px;
    margin-top: 18px;
  }

  .action-break {
    display: none;
  }

  .action-card {
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
  }

  .hero-search {
    right: 12px;
    bottom: 26px;
    left: 12px;
    width: calc(100% - 24px);
  }

  .trust-note {
    bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing-dot {
    animation: none;
    opacity: .7;
  }

  .sidebar {
    transition: none;
  }
}

/* Compact conversation bubbles used by the KHP UAT chat. */
.chat .message {
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 612px;
  margin: 0 auto 16px;
}

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

.chat .message .avatar,
.user-message-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.chat .message .avatar {
  border: 1px solid #ddd8cf;
  background: #fff;
}

.user-message-avatar {
  display: grid;
  place-items: center;
  background: #ed7203;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.chat .message .bubble {
  position: relative;
  width: fit-content;
  max-width: min(560px, calc(100% - 40px));
  padding: 9px 12px;
  border: 1px solid #dedad3;
  border-radius: 9px;
  background: #fff;
  color: #272522;
  font-size: 11px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(36, 32, 27, .07);
}

.chat .message.user .bubble {
  padding: 9px 12px;
  border: 0;
  border-radius: 12px 12px 4px 12px;
  background: #1d1d1b;
  color: #fff;
  box-shadow: none;
}

.chat .feedback-actions {
  display: none;
}

@media (max-width: 760px) {
  .chat .message .bubble {
    max-width: calc(100% - 44px);
    font-size: 12px;
  }
}

@media (min-width: 761px) {
  .app-shell {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .sidebar {
    width: 176px;
  }

  .brand {
    padding-left: 10px;
  }

  .brand strong {
    font-size: 12px;
  }

  .new-chat {
    margin-right: 9px;
    padding: 0 10px;
  }

  .history-panel {
    padding-right: 7px;
    padding-left: 7px;
  }

  .topbar {
    padding-right: 12px;
    padding-left: 14px;
  }

  .chat {
    padding: 34px 24px 24px;
  }
}

.support-card.advisor-card {
  position: relative;
  min-height: 104px;
  padding: 17px 82px 15px 15px;
  overflow: hidden;
  background: #f8faf8;
}

.advisor-card-copy {
  position: relative;
  z-index: 1;
}

.advisor-card-copy strong,
.advisor-card-copy span {
  display: block;
}

.advisor-card-copy strong {
  color: #26332f;
  font-size: 11px;
  line-height: 1.35;
}

.advisor-card-copy span {
  margin-top: 7px;
  color: #7d8984;
  font-size: 8px;
  line-height: 1.5;
}

.support-card.advisor-card > img {
  position: absolute;
  right: 5px;
  bottom: -12px;
  width: 82px;
  height: 105px;
  object-fit: contain;
  object-position: center bottom;
}

/* Unified responsive conversation layout. */
:root {
  --chat-rail: 1160px;
  --ai-bubble: 680px;
  --user-bubble: 520px;
}

.brand {
  align-items: center;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: visible;
}

.brand-copy strong {
  color: #17211d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-copy small {
  display: block !important;
  overflow: visible;
  color: #7b8581;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  opacity: 1 !important;
  visibility: visible !important;
  white-space: nowrap;
}

.support-card.advisor-card {
  width: auto;
  min-height: 108px;
  margin: 10px 18px;
  padding: 17px 88px 15px 15px;
  border: 1px solid #dbe6e1;
  border-radius: 11px;
  background: #f8faf8;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.support-card.advisor-card:hover,
.support-card.advisor-card:focus-visible {
  border-color: #c9dbd4;
  outline: none;
  box-shadow: 0 5px 14px rgba(18, 58, 47, .08);
  transform: translateY(-1px);
}

.advisor-card-copy strong {
  font-size: 11px;
  line-height: 1.4;
}

.advisor-card-copy span {
  margin-top: 6px;
  font-size: 9px;
  line-height: 1.55;
}

.support-card.advisor-card > img {
  right: 4px;
  bottom: -10px;
  width: 90px;
  height: 114px;
}

.workspace {
  position: relative;
  min-width: 0;
}

.chat {
  box-sizing: border-box;
  padding: 26px 36px 140px !important;
  overflow-x: hidden;
  background: #fafbf9;
}

.chat .message,
.chat .message.user,
.chat .message.loading-message {
  box-sizing: border-box;
  width: min(var(--chat-rail), 100%) !important;
  max-width: var(--chat-rail) !important;
  margin: 0 auto 18px !important;
}

.chat .message {
  align-items: flex-end;
  gap: 10px;
}

.chat .message-content {
  width: auto;
  max-width: var(--ai-bubble);
}

.chat .message.has-cards .message-content,
.chat .message.has-wizard .message-content {
  width: calc(100% - 50px);
  max-width: calc(100% - 50px);
}

.chat .message .bubble {
  box-sizing: border-box;
  width: fit-content;
  max-width: var(--ai-bubble);
  height: auto !important;
  min-height: 0 !important;
  padding: 14px 16px;
  border: 1px solid #dce3df;
  border-radius: 10px 10px 10px 3px;
  background: #fff;
  font-size: 13px;
  line-height: 1.6;
  white-space: normal !important;
  box-shadow: 0 3px 10px rgba(25, 50, 42, .06);
}

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

.chat .message.user .bubble {
  width: fit-content !important;
  max-width: var(--user-bubble);
  margin-left: auto;
  padding: 12px 15px !important;
  border: 0;
  border-radius: 11px 11px 3px 11px;
  background: #006b58;
  color: #fff;
  box-shadow: none;
}

.chat .message .avatar,
.chat .user-message-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}

.conversation-wizard {
  box-sizing: border-box;
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #cfddd7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(25, 50, 42, .04);
}

.wizard-heading {
  gap: 7px;
}

.wizard-heading > div {
  align-items: center;
}

.wizard-heading progress {
  height: 4px;
}

.conversation-wizard > p {
  margin: 10px 0 9px;
  font-size: 15px;
  line-height: 1.4;
}

.wizard-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wizard-options button {
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.4;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.wizard-options button:hover,
.wizard-options button:focus-visible,
.wizard-options button.selected {
  border-color: #13806b;
  outline: none;
  background: #eef7f3;
  box-shadow: inset 0 0 0 1px rgba(19, 128, 107, .12);
}

.wizard-custom-form {
  min-height: 42px;
  margin-top: 9px;
}

.wizard-custom-form input {
  padding: 9px 12px;
  font-size: 12px;
}

.wizard-custom-form button {
  width: 42px;
  flex: 0 0 42px;
}

.wizard-actions {
  margin-top: 7px;
}

.property-results {
  box-sizing: border-box;
  width: 100%;
  margin-top: 22px;
}

.property-results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #26332f;
}

.property-results-heading strong {
  font-size: 14px;
  line-height: 1.4;
}

.chat .property-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: none;
  padding: 0;
  overflow: visible;
}

.chat .property-card {
  display: flex;
  min-width: 0;
  height: auto;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid #dde4e0;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(25, 50, 42, .055);
  transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.chat .property-card:hover {
  border-color: #cbdad4;
  box-shadow: 0 7px 18px rgba(25, 50, 42, .09);
  transform: translateY(-2px);
}

.chat .property-media {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 !important;
  padding: 0;
  aspect-ratio: 1.55 / 1;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #edf1ef;
}

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

.chat .property-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 12px 13px 6px;
}

.chat .property-card-body > strong {
  min-height: 39px;
  color: #173f35;
  font-size: 12px;
  line-height: 1.45;
}

.chat .property-location {
  min-height: 31px;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.45;
}

.chat .property-facts {
  display: grid;
  gap: 3px;
  min-height: 34px;
  margin-top: 6px;
  overflow: hidden;
}

.chat .property-facts span {
  max-width: 100%;
  color: #65736e;
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat .property-card-body > b {
  min-height: 40px;
  margin-top: 8px;
  color: #08715d;
  font-size: 13px;
  line-height: 1.4;
}

.chat .property-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-height: 0;
  margin-top: auto;
  padding: 8px 12px 12px;
}

.chat .property-actions button,
.chat .property-actions a {
  min-width: 0;
  min-height: 36px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.25;
}

.chat .property-actions a {
  grid-column: 1 / -1;
  min-height: 24px;
}

.composer {
  box-sizing: border-box;
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0 !important;
  padding: 10px 24px 12px !important;
  background: linear-gradient(to top, #fafbf9 72%, rgba(250, 251, 249, .92));
}

.composer-box {
  box-sizing: border-box;
  width: min(1020px, 100%) !important;
  max-width: 1020px !important;
  min-height: 54px;
  margin: 0 auto;
  border-radius: 28px;
}

.composer > small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.35;
}

@media (min-width: 1181px) {
  .app-shell {
    grid-template-columns: 266px minmax(0, 1fr);
  }

  .sidebar {
    width: 266px;
    grid-template-rows: 88px 72px minmax(220px, 1fr) auto 66px !important;
  }

  .brand {
    padding: 14px 20px;
  }

  .sidebar-brand-logo {
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .sidebar {
    width: 230px;
    grid-template-rows: 78px 64px minmax(180px, 1fr) auto 62px !important;
  }

  .brand {
    padding: 10px 14px;
  }

  .sidebar-brand-logo {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 10px;
    white-space: normal;
  }

  .chat {
    padding-right: 24px !important;
    padding-left: 24px !important;
  }

  .chat .property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1181px) and (max-width: 1450px) {
  .chat .property-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --ai-bubble: calc(100vw - 66px);
    --user-bubble: calc(100vw - 66px);
  }

  .topbar {
    min-height: 56px;
    padding: 6px 10px;
  }

  .chat-heading h1 {
    font-size: 14px;
  }

  .chat-heading p {
    font-size: 10px;
  }

  .sidebar .brand {
    min-height: 72px;
    padding: 9px 14px;
  }

  .sidebar-brand-logo {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 10px;
    white-space: normal;
  }

  .support-card.advisor-card {
    display: block;
  }

  .chat {
    padding: 16px 10px 132px !important;
  }

  .chat .message,
  .chat .message.user,
  .chat .message.loading-message {
    width: 100% !important;
    max-width: none !important;
    margin-bottom: 14px !important;
  }

  .chat .message {
    gap: 7px;
  }

  .chat .message .avatar,
  .chat .user-message-avatar {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .chat .message-content,
  .chat .message.has-cards .message-content,
  .chat .message.has-wizard .message-content {
    width: calc(100% - 37px);
    max-width: calc(100% - 37px);
  }

  .chat .message .bubble,
  .chat .message.user .bubble {
    max-width: 100%;
    padding: 11px 12px !important;
    font-size: 13px;
  }

  .conversation-wizard {
    padding: 11px;
    border-radius: 9px;
  }

  .conversation-wizard > p {
    margin: 9px 0 8px;
    font-size: 14px;
  }

  .wizard-options {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .wizard-options button {
    min-height: 46px;
    padding: 9px 11px;
    text-align: left;
  }

  .wizard-custom-form {
    display: flex;
    width: 100%;
  }

  .wizard-custom-form input {
    min-width: 0;
  }

  .property-results {
    margin-top: 20px;
  }

  .property-results-heading strong {
    font-size: 13px;
  }

  .chat .property-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .chat .property-card {
    width: 100% !important;
    min-width: 0;
    flex: none;
  }

  .chat .property-media {
    aspect-ratio: 16 / 9;
  }

  .chat .property-card-body > strong {
    min-height: 0;
    font-size: 13px;
  }

  .chat .property-location,
  .chat .property-facts span {
    font-size: 10px;
  }

  .chat .property-card-body > b {
    min-height: 0;
    font-size: 14px;
  }

  .chat .property-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat .property-actions button {
    min-height: 40px;
    font-size: 10px;
  }

  .composer {
    right: 0;
    left: 0;
    padding: 8px 9px 9px !important;
  }

  .composer-box {
    width: 100% !important;
    min-height: 50px;
  }

  .composer > small {
    font-size: 10px;
  }
}

/* Message controls live below the answer bubble instead of stretching it. */
.chat .message-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  max-width: min(560px, calc(100% - 36px));
}

.chat .message-content > .bubble {
  max-width: 100%;
}

.chat .message-content > .quick-options,
.chat .message-content > .inline-query-form,
.chat .message-content > .conversation-wizard,
.chat .message-content > .property-grid {
  width: 100%;
}

/* Keep inventory cards aligned even when their fact counts differ. */
.property-grid {
  align-items: stretch;
}

.property-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.property-card > strong {
  min-height: 42px;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.property-card > b {
  margin-top: auto;
  padding-top: 12px;
  line-height: 1.35;
}

.property-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  min-height: 76px;
}

.property-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px;
  line-height: 1.25;
  white-space: normal;
}

.property-actions a {
  grid-column: 1 / -1;
  min-height: 18px;
  line-height: 1.35;
}

.project-card .property-actions {
  grid-template-columns: 1fr;
  min-height: 42px;
}

.project-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 42px !important;
  padding: 9px 14px;
  border: 1px solid #006b58;
  border-radius: 5px;
  background: #006b58;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.project-detail-link:hover {
  border-color: #004f42;
  background: #004f42;
}

.project-detail-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-close {
  display: none;
}

@media (max-width: 760px) {
  html,
  body,
  .app-shell,
  .workspace {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .workspace {
    height: 100dvh;
    grid-template-rows: 58px minmax(0, 1fr) auto;
  }

  .app-shell:not(.chat-mode) .workspace {
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .sidebar {
    z-index: 40;
    box-shadow: 12px 0 28px rgba(25, 28, 26, .14);
    will-change: transform;
    touch-action: pan-y;
  }

  .sidebar .brand {
    gap: 5px;
    padding: 0 0 0 7px;
  }

  .sidebar-close {
    display: grid;
    flex: 0 0 28px;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #68635c;
  }

  .sidebar-close svg {
    width: 19px;
    height: 19px;
  }

  .sidebar-close:active,
  .sidebar-close:hover {
    background: #efede8;
    color: #24221f;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(24, 28, 26, .28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .sidebar.open + .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .topbar {
    min-height: 58px;
    padding: 8px 14px;
  }

  .chat-heading {
    flex: 1 1 auto;
    min-width: 0;
  }

  .chat-heading > div {
    min-width: 0;
  }

  .chat-heading h1 {
    font-size: 15px;
  }

  .chat-heading p {
    display: block;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }

  .profile-button {
    flex: 0 0 30px;
    margin-left: 8px;
  }

  .welcome-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .welcome-panel h1 {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.35;
    white-space: normal;
  }

  .welcome-panel > p {
    width: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .welcome-panel .quick-actions {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0 2px;
  }

  .welcome-panel .action-card {
    max-width: 100%;
  }

  .welcome-panel .action-card span {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .welcome-panel .hero-search {
    max-width: calc(100% - 24px);
  }

  .chat {
    padding: 22px 14px 28px;
    scroll-padding-bottom: 92px;
  }

  .chat .message {
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    max-width: none;
    margin-bottom: 18px;
  }

  .chat .message .avatar,
  .user-message-avatar {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
  }

  .chat .message-content {
    max-width: calc(100% - 38px);
  }

  .chat .message .bubble {
    width: fit-content;
    max-width: 100%;
    padding: 11px 13px;
    border-radius: 10px 10px 10px 3px;
    font-size: 14px;
    line-height: 1.55;
  }

  .chat .message.user .bubble {
    max-width: calc(100% - 38px);
    padding: 10px 13px;
    border-radius: 12px 12px 3px 12px;
  }

  .quick-options {
    display: flex;
    flex-wrap: wrap;
    grid-template-columns: none;
    gap: 8px;
    margin-top: 10px;
  }

  .quick-options button {
    flex: 0 1 auto;
    width: auto;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
  }

  .inline-query-form {
    min-height: 48px;
    margin-top: 10px;
    padding: 5px 5px 5px 10px;
    border-radius: 10px;
  }

  .inline-query-input {
    width: 100%;
    padding: 7px 3px;
    font-size: 13px;
  }

  .inline-query-form > button {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }

  .conversation-wizard {
    margin-top: 10px;
    padding: 12px;
  }

  .wizard-options {
    grid-template-columns: 1fr;
  }

  .wizard-options button {
    min-height: 42px;
    font-size: 12px;
  }

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

  .property-actions {
    gap: 8px;
    min-height: 72px;
  }

  .property-actions button,
  .property-actions a {
    font-size: 11px;
  }

  .composer {
    padding: 8px 12px max(10px, env(safe-area-inset-bottom));
  }

  .composer-box {
    width: 100%;
    min-height: 48px;
    padding: 5px 5px 5px 10px;
  }

  .composer-box textarea {
    min-width: 0;
    padding: 8px 3px;
    font-size: 13px;
  }

  .send-button {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 760px) {
  .workspace,
  .chat,
  .message-content,
  .inline-query-form,
  .composer,
  .composer-box {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .inline-query-input,
  .composer-box textarea,
  .hero-search input {
    min-width: 0;
    font-size: 16px !important;
  }

  .send-button,
  .inline-query-form > button,
  .hero-search > button[type="submit"] {
    flex-shrink: 0;
  }
}

/* Dashboard refresh; scoped so the conversation UI keeps its current behavior. */
.support-card{grid-column:1/-1;align-self:end;margin:10px 12px;padding:14px;border:1px solid #dce5e1;border-radius:8px;background:#f8fbfa}.support-title{display:flex;gap:8px;align-items:center;margin-bottom:12px;color:#24332f;font-size:11px}.support-title svg{width:15px;color:#08715d}.support-card>span{display:block;margin-top:8px;color:#8b948f;font-size:8px}.support-card>a{color:#08715d;font-size:9px;font-weight:700;text-decoration:none}.sidebar{grid-template-rows:42px minmax(0,1fr) auto auto}
.app-shell:not(.chat-mode) .welcome-panel{justify-content:flex-start;padding-top:28px;padding-bottom:124px;background:#f7f6f3!important;background-image:none!important}.app-shell:not(.chat-mode) .welcome-panel::before,.app-shell:not(.chat-mode) .welcome-panel::after{display:none!important}.app-shell:not(.chat-mode) .welcome-brand{width:82px;height:82px}.app-shell:not(.chat-mode) .welcome-panel h1{max-width:900px;margin-top:12px;color:#006653;font-size:26px}.app-shell:not(.chat-mode) .welcome-panel>p{max-width:850px;font-size:14px}.app-shell:not(.chat-mode) .quick-actions{width:min(820px,100%);margin-top:20px;gap:14px}.app-shell:not(.chat-mode) .action-card{justify-content:flex-start;gap:11px;width:170px;height:62px;padding:8px 13px;border-radius:9px;box-shadow:0 2px 8px rgba(28,49,43,.07)}.app-shell:not(.chat-mode) .action-card>svg{flex:0 0 36px;width:36px;height:36px;padding:8px;border-radius:50%;background:#edf5f2;color:#08715d}.app-shell:not(.chat-mode) .action-card span{font-size:13px;line-height:1.35;text-align:left;white-space:normal}
.featured-showcase{width:min(1050px,100%);margin-top:32px}.featured-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.featured-heading h2{display:flex;gap:8px;align-items:center;margin:0;color:#27332f;font-size:15px}.featured-heading h2 svg{width:20px;color:#08715d}.featured-heading button{display:flex;gap:3px;align-items:center;border:0;background:none;color:#08715d;font-size:11px;font-weight:700}.featured-heading button svg{width:14px}.featured-home-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;min-height:246px}.featured-home-card{overflow:hidden;border:1px solid #dcdedb;border-radius:8px;background:#fff;box-shadow:0 2px 8px rgba(28,49,43,.07)}.featured-home-card>img{display:block;width:100%;height:160px;object-fit:cover}.featured-home-body{padding:11px 13px}.featured-home-body>strong{display:block;overflow:hidden;color:#26332f;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.featured-home-body>span{display:flex;gap:4px;align-items:center;overflow:hidden;margin-top:5px;color:#7d8782;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.featured-home-body>span svg{flex:0 0 11px;width:11px}.featured-home-body>div{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-top:11px}.featured-home-body b{overflow:hidden;color:#08715d;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.featured-home-body a,.featured-home-body button{padding:6px 11px;border:1px solid #5ca895;border-radius:5px;background:#fff;color:#08715d;font-size:10px;font-weight:700;text-decoration:none;white-space:nowrap}.featured-home-loading,.featured-home-empty{grid-column:1/-1;display:grid;place-items:center;color:#7f8985;font-size:11px}
@media(max-width:760px){.support-card{display:none}.app-shell:not(.chat-mode) .welcome-panel{padding-top:24px;padding-bottom:115px}.app-shell:not(.chat-mode) .welcome-brand{width:62px;height:62px}.app-shell:not(.chat-mode) .welcome-panel h1{font-size:17px}.app-shell:not(.chat-mode) .quick-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.app-shell:not(.chat-mode) .action-break{display:none}.app-shell:not(.chat-mode) .action-card{width:100%}.featured-showcase{margin-top:18px}.featured-home-grid{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:4px}.featured-home-card{flex:0 0 78%;scroll-snap-align:start}}

@media (min-width:761px) {
  .app-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .sidebar { grid-template-rows: 56px 50px minmax(0, 1fr) auto auto; }
  .brand { grid-column: 1 / -1; gap: 10px; padding: 0 16px; }
  .brand strong { font-size: 15px; }
  .new-chat { grid-column: 1 / -1; width: auto; min-height: 36px; margin: 4px 14px 10px; padding: 0 14px; font-size: 12px; }
  .workspace { grid-template-rows: 56px minmax(0, 1fr) auto; }
  .app-shell:not(.chat-mode) .workspace { grid-template-rows: 56px minmax(0, 1fr); }
  .topbar { min-height: 56px; padding: 0 18px; }
  .topbar-avatar { width: 34px; height: 34px; }
  .chat-heading h1 { font-size: 13px; }
  .chat-heading p { font-size: 9px; }
  .history-title { font-size: 10px; }
  .history-search { min-height: 36px; }
  .history-search input,
  .history-item { font-size: 11px; }

  .app-shell:not(.chat-mode) .quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    column-gap: 14px;
    row-gap: 14px;
    width: min(820px, 100%);
  }

  .app-shell:not(.chat-mode) .action-break {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    height: 0;
  }

  .app-shell:not(.chat-mode) .action-card {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr);
    flex: 0 0 clamp(150px, 12vw, 190px);
    align-items: center !important;
    justify-content: initial;
    width: clamp(150px, 12vw, 190px);
    height: 62px;
    min-height: 62px;
    padding: 8px 13px;
    gap: 11px;
  }

  .app-shell:not(.chat-mode) .action-card > svg {
    display: block;
    position: static;
    width: 36px;
    height: 36px;
    margin: 0;
    transform: none;
  }

  .app-shell:not(.chat-mode) .action-card > span {
    display: flex !important;
    position: static !important;
    align-items: center;
    width: auto;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
  }

  .app-shell:not(.chat-mode) .hero-search {
    right: 24px;
    bottom: 28px;
    left: 24px;
    width: min(960px, calc(100% - 48px));
    min-height: 60px;
    padding: 6px 8px;
    border-radius: 32px;
  }

  .app-shell:not(.chat-mode) .hero-search input {
    padding: 0 10px;
    font-size: 14px;
  }

  .app-shell:not(.chat-mode) .hero-search > button:last-child {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .app-shell:not(.chat-mode) .hero-search > button:last-child svg {
    width: 19px;
    height: 19px;
  }

  .app-shell:not(.chat-mode) .hero-search .composer-tool {
    width: 32px;
    height: 38px;
    flex-basis: 32px;
  }

  .app-shell:not(.chat-mode) .hero-search .composer-tool svg {
    width: 17px;
    height: 17px;
  }
}

.sidebar-brand-logo {
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width:760px) {
  .sidebar-brand-logo { width: 32px; height: 32px; }
}

/* Keep sidebar header controls in their own full-width rows at every size. */
.sidebar {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: 56px 50px minmax(0, 1fr) auto auto !important;
  column-gap: 0 !important;
}

.sidebar .brand {
  position: relative;
  grid-column: 1;
  width: 100%;
  min-width: 0;
  padding: 0 16px;
  box-sizing: border-box;
}

.sidebar .brand strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .new-chat {
  grid-column: 1;
  justify-self: stretch;
  width: auto;
  margin: 4px 14px 10px;
  box-sizing: border-box;
}

.sidebar .history-panel,
.sidebar .support-card,
.sidebar .sidebar-footer { grid-column: 1; }

@media (max-width:760px) {
  .sidebar .brand { padding-right: 52px; }
  .sidebar .sidebar-close {
    position: absolute;
    right: 10px;
    left: auto;
    margin: 0;
  }
}

/* Final alignment lock: customer bubble always ends at the result rail edge. */
.chat .message.user {
  align-self: stretch !important;
  flex: 0 0 auto;
  width: 100% !important;
  min-width: 0;
  max-width: 1128px !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

.chat .message.user > .bubble {
  margin-right: 0 !important;
  margin-left: auto !important;
  align-self: center !important;
  flex: 0 0 auto !important;
  width: fit-content !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 11px 14px !important;
  white-space: normal !important;
}

.chat .message.user > .user-message-avatar {
  align-self: center !important;
}

/* Compact horizontal inventory results; regular chat bubbles keep their width. */
@media (min-width:761px) {
  .chat .message.has-cards { width: 100%; max-width: none; }
  .chat .message.has-cards .message-content { width: calc(100% - 46px); max-width: none; }
  .chat .message.has-cards .message-content > .bubble { width: fit-content; max-width: 680px; }
  .chat .message.has-cards .property-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    max-width: none;
    gap: 12px;
  }
}

.chat .property-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(25, 50, 42, .08);
}

.chat .property-media { width: 100%; aspect-ratio: 1.55 / 1; overflow: hidden; background: #e8efec; }
.chat .property-media img { width: 100%; height: 100%; object-fit: cover; }
.chat .property-card-body { display: flex; flex: 1; flex-direction: column; padding: 11px 12px 5px; }
.chat .property-card-body > strong { min-height: 38px; color: #153f35; font-size: 13px; line-height: 1.4; }
.chat .property-location { display: flex; gap: 4px; align-items: flex-start; min-height: 27px; margin-top: 4px; color: #71807a; font-size: 9px; line-height: 1.4; }
.chat .property-location svg { flex: 0 0 11px; width: 11px; height: 11px; margin-top: 1px; }
.chat .property-facts { display: grid; gap: 3px; margin-top: 6px; }
.chat .property-facts span { overflow: hidden; color: #66736e; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.chat .property-card-body > b { display: block; margin-top: 9px; color: #08715d; font-size: 13px; line-height: 1.4; }
.chat .property-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; min-height: 0; margin-top: auto; padding: 9px 12px 12px; }
.chat .property-actions button,
.chat .property-actions a { display: grid; place-items: center; min-height: 34px; padding: 6px 8px; border-radius: 5px; font-size: 9px; text-align: center; }
.chat .property-actions a { grid-column: 1 / -1; min-height: 27px; }

@media (max-width:1200px) and (min-width:761px) {
  .chat .message.has-cards .property-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width:760px) {
  .chat .property-card-body { padding: 12px 13px 6px; }
  .chat .property-actions { min-height: 0; padding: 10px 13px 13px; }
}

/* Inventory carousel: one balanced row instead of full-screen stretched cards. */
@media (min-width:761px) {
  .chat .message.has-cards .message-content {
    width: min(1060px, calc(100% - 46px));
    max-width: 1060px;
  }

  .chat .message.has-cards .property-grid {
    display: flex;
    grid-template-columns: none;
    gap: 10px;
    width: 100%;
    max-width: 1060px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .chat .message.has-cards .property-card {
    flex: 0 0 255px;
    width: 255px;
    scroll-snap-align: start;
  }
}

.chat .property-media { aspect-ratio: 1.72 / 1; }
.chat .property-card-body { padding: 9px 10px 4px; }
.chat .property-card-body > strong { min-height: 35px; font-size: 11px; line-height: 1.4; }
.chat .property-location { min-height: 24px; margin-top: 2px; font-size: 8px; }
.chat .property-facts { display: flex; gap: 5px; min-height: 16px; margin-top: 5px; overflow: hidden; }
.chat .property-facts span { max-width: 50%; font-size: 8px; }
.chat .property-card-body > b { min-height: 35px; margin-top: 6px; font-size: 11px; }
.chat .property-actions { gap: 6px; padding: 7px 10px 10px; }
.chat .property-actions button,
.chat .property-actions a { min-height: 30px; font-size: 8px; }
.chat .property-actions a { min-height: 24px; }

@media (max-width:760px) {
  .chat .property-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .chat .property-card { flex: 0 0 84%; scroll-snap-align: start; }
}

/* Use the full result width until a customer opens a property detail. */
@media (min-width:761px) {
  .chat .message.has-cards .message-content,
  .chat .message.has-cards .property-grid {
    width: 100%;
    max-width: none;
  }
}

.message-text { display: block; white-space: pre-wrap; }
.collapsible-answer .message-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.collapsible-answer.expanded .message-text { display: block; overflow: visible; }
.answer-toggle {
  display: block;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #08715d;
  font-size: 10px;
  font-weight: 700;
}

/* Align customer turns with the inventory rail and stabilize card media. */
@media (min-width:761px) {
  .chat .message.user {
    display: flex;
    align-self: center;
    justify-content: flex-end !important;
    width: min(1128px, 100%) !important;
    max-width: 1128px !important;
    margin-right: auto !important;
    margin-left: auto !important;
    box-sizing: border-box;
  }

  .chat .message.user .bubble {
    width: fit-content;
    max-width: min(520px, calc(100% - 50px));
  }

  .chat .message.has-cards,
  .chat .message.has-cards .message-content,
  .chat .message.has-cards .property-grid { box-sizing: border-box; }
}

.chat .property-media {
  width: 100%;
  height: auto;
  margin: 0 !important;
  aspect-ratio: 1.9 / 1;
  overflow: hidden;
  background: #edf1ef;
}

.chat .property-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

@media (max-width:760px) {
  .chat .message.user {
    display: flex;
    justify-content: flex-end !important;
    width: 100% !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: auto !important;
    box-sizing: border-box;
  }

  .chat .message.user .bubble {
    width: fit-content;
    max-width: calc(100% - 46px);
  }
}

.chat .property-media {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.chat .property-media:focus-visible { outline: 3px solid #d2a54a; outline-offset: -3px; }
.workspace { position: relative; }
.property-detail-drawer[hidden] { display: none; }
.property-detail-drawer {
  position: absolute;
  z-index: 15;
  top: 70px;
  right: 12px;
  bottom: 12px;
  display: flex;
  width: 340px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e0e3e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: -8px 0 24px rgba(28, 48, 41, .08);
}

.property-detail-header { display: flex; justify-content: space-between; align-items: center; padding: 17px 18px 12px; }
.property-detail-header strong { color: #26332f; font-size: 13px; }
.property-detail-header button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: #68736f; }
.property-detail-header button svg { width: 17px; }
#propertyDetailContent { display: flex; min-height: 0; flex: 1; flex-direction: column; padding: 0 18px 18px; overflow-y: auto; }
.property-detail-image { width: 100%; aspect-ratio: 1 / 1.05; border-radius: 10px; object-fit: cover; }
#propertyDetailContent h2 { margin: 14px 0 8px; color: #25332e; font-size: 15px; line-height: 1.45; }
.property-detail-price { color: #08715d; font-size: 20px; line-height: 1.4; }
.property-detail-location { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; color: #697671; font-size: 10px; line-height: 1.45; }
.property-detail-location svg { flex: 0 0 13px; width: 13px; margin-top: 1px; }
.property-detail-facts { display: grid; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid #edf0ee; }
.property-detail-facts span { display: flex; gap: 7px; color: #52615c; font-size: 10px; line-height: 1.45; }
.property-detail-facts svg { flex: 0 0 13px; width: 13px; color: #159276; }
.property-detail-actions { display: grid; gap: 8px; margin-top: auto; padding-top: 22px; }
.property-detail-actions button,
.property-detail-actions a { display: flex; justify-content: center; gap: 7px; align-items: center; min-height: 40px; border: 1px solid #08715d; border-radius: 6px; font-size: 10px; font-weight: 700; text-decoration: none; }
.property-detail-actions button { background: #08715d; color: #fff; }
.property-detail-actions a { background: #fff; color: #08715d; }
.property-detail-actions svg { width: 14px; }

@media (max-width:760px) {
  .property-detail-drawer { position: fixed; z-index: 60; inset: 8px; width: auto; border-radius: 14px; }
  .property-detail-image { aspect-ratio: 1.25 / 1; }
}

/* Desktop layout matched to the approved KHP Land reference. */
@media (min-width:761px) {
  .app-shell { grid-template-columns: 266px minmax(0, 1fr); }
  .sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    justify-self: stretch;
    grid-template-rows: 88px 72px minmax(220px, 1fr) auto auto 66px !important;
    border-right-color: #e5e8e6;
    background: #fff;
  }

  .sidebar .brand { gap: 14px; padding: 0 22px; }
  .sidebar-brand-logo { flex-basis: 56px; width: 56px; height: 56px; }
  .sidebar .brand strong { color: #1f2d28; font-size: 18px; }
  .sidebar .new-chat {
    min-height: 44px;
    margin: 10px 22px 16px;
    border-radius: 7px;
    background: #006653;
    font-size: 13px;
  }

  .history-panel { padding: 14px 20px; }
  .history-title { margin-bottom: 10px; padding: 0; font-size: 11px; }
  .history-search { min-height: 43px; margin-bottom: 16px; border-radius: 7px; background: #fff; }
  .history-search input { font-size: 12px; }
  .history-item { min-height: 42px; padding: 9px 34px 9px 28px; font-size: 11px; }

  .sidebar-utilities {
    display: grid;
    gap: 3px;
    padding: 14px 20px;
    border-top: 1px solid #edf0ee;
  }
  .sidebar-utilities > span { margin-bottom: 5px; color: #7e8884; font-size: 10px; font-weight: 700; }
  .sidebar-utilities button { display: flex; gap: 11px; align-items: center; min-height: 36px; padding: 0; border: 0; background: transparent; color: #34423d; font-size: 11px; text-align: left; }
  .sidebar-utilities button:hover { color: #08715d; }
  .sidebar-utilities svg { width: 16px; height: 16px; }
  .support-card { margin: 10px 20px 14px; padding: 14px 16px; }
  .sidebar-footer { min-height: 66px; padding: 10px 20px; }

  .workspace { grid-template-rows: 88px minmax(0, 1fr) auto; }
  .app-shell:not(.chat-mode) .workspace { grid-template-rows: 88px minmax(0, 1fr); }
  .topbar { min-height: 88px; padding: 0 34px; background: #fff; }
  .topbar-avatar { width: 44px; height: 44px; }
  .chat-heading { gap: 12px; }
  .chat-heading h1 { font-size: 17px; }
  .chat-heading p { font-size: 10px; }
  .profile-button { width: 34px; height: 34px; border-radius: 50%; }

  .chat { padding: 66px 48px 118px; background: #fafbf9; }
  .chat .message {
    width: min(1128px, 100%);
    max-width: 1128px;
    margin-right: auto;
    margin-left: auto;
  }
  .chat .message.user { width: min(1128px, 100%); max-width: 1128px; margin-right: auto; margin-left: auto; }
  .chat .message.user .bubble { border: 0; background: #006653; color: #fff; }
  .chat .message .avatar { width: 40px; height: 40px; flex-basis: 40px; }
  .chat .message-content { max-width: calc(100% - 54px); }
  .chat .message.has-cards .message-content { width: calc(100% - 54px); max-width: calc(100% - 54px); }
  .chat .message .bubble { max-width: 570px; padding: 15px 17px; font-size: 12px; line-height: 1.55; }

  .conversation-wizard { width: 100%; margin-top: 14px; padding: 17px 20px; border-radius: 9px; background: #fff; }
  .wizard-heading { margin-bottom: 10px; }
  .conversation-wizard > p { margin: 12px 0 10px; font-size: 16px; font-weight: 700; }
  .wizard-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .wizard-options button { min-height: 66px; border-radius: 7px; font-size: 12px; }
  .wizard-custom-form { min-height: 44px; }

  .chat .message.has-cards .property-grid {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 14px;
    margin-top: 20px;
    overflow-x: auto;
  }
  .chat .message.has-cards .property-card { flex: 0 0 calc((100% - 42px) / 4); width: calc((100% - 42px) / 4); }
  .chat .property-media { aspect-ratio: 1.55 / 1; }
  .chat .property-card-body { padding: 10px 12px 5px; }
  .chat .property-card-body > strong { min-height: 36px; font-size: 11px; }
  .chat .property-card-body > b { font-size: 13px; }
  .chat .property-actions { padding: 8px 12px 12px; }

  .composer { padding: 10px 48px 14px; background: #fafbf9; }
  .composer-box { width: min(1128px, 100%); max-width: 1128px; min-height: 58px; padding: 6px 7px 6px 18px; }
  .composer-box textarea { font-size: 12px; }
  .send-button { width: 44px; height: 44px; flex-basis: 44px; }
  .composer > small { font-size: 9px; }
}

/* Final rail alignment. This must remain after every desktop override. */
.chat .message .bubble {
  height: auto !important;
  min-height: 0 !important;
  white-space: normal !important;
}

.chat .message.user {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  justify-content: flex-end !important;
}

.chat .message.loading-message {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  justify-content: flex-start !important;
}

.sidebar-utilities button {
  width: 100%;
  padding: 0 10px !important;
  border: 1px solid transparent !important;
  border-radius: 6px;
  outline: none !important;
}

.sidebar-utilities button:hover,
.sidebar-utilities button:focus-visible {
  border-color: #d7e5e0 !important;
  background: #edf5f2 !important;
  color: #08715d !important;
}

@media (min-width: 761px) {
  .sidebar {
    grid-template-rows: 88px 72px minmax(220px, 1fr) auto 66px !important;
  }
}

/* Project results use an independent full-width rail below the compact reply. */
.chat .message.has-projects {
  width: min(1128px, 100%);
  max-width: 1128px;
}

.chat .message.has-projects .message-content {
  width: calc(100% - 54px);
  max-width: none;
}

.chat .message.has-projects .message-content > .bubble {
  width: fit-content;
  max-width: 650px;
}

.project-results {
  width: 100%;
  min-width: 0;
  margin-top: 26px;
}

.project-results-heading {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  color: #263c35;
  font-size: 14px;
}

.project-carousel {
  position: relative;
  width: 100%;
  min-width: 0;
}

.chat .project-grid {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 14px;
  margin: 0;
  padding: 2px 2px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.chat .project-grid::-webkit-scrollbar {
  display: none;
}

.chat .project-grid .project-card {
  flex: 0 0 calc((100% - 42px) / 4);
  width: calc((100% - 42px) / 4);
  height: auto;
  min-width: 0;
  scroll-snap-align: start;
  border: 1px solid #e1e6e3;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(24, 57, 47, .08);
}

.chat .project-card .property-media {
  flex: 0 0 auto;
  aspect-ratio: 1.35 / 1;
  cursor: default;
}

.project-card-body {
  display: flex;
  min-height: 178px;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding: 14px 15px 8px;
}

.project-card-body > strong {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #123f34;
  font-size: 14px;
  line-height: 1.45;
}

.project-card-body > span {
  display: block;
  overflow: hidden;
  color: #74807c;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-body .project-address {
  display: flex;
  gap: 5px;
  align-items: flex-start;
  min-height: 32px;
  white-space: normal;
}

.project-card-body .project-address svg {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  margin-top: 1px;
}

.project-card-body > b {
  margin-top: auto;
  color: #c18718;
  font-size: 14px;
  line-height: 1.4;
}

.chat .project-card .property-actions {
  min-height: 0;
  margin-top: auto;
  padding: 8px 15px 15px;
}

.chat .project-card .project-detail-link {
  min-height: 40px !important;
  border-radius: 7px;
  background: #08715d;
  color: #fff;
  font-size: 11px;
}

.project-carousel-arrow {
  position: absolute;
  z-index: 3;
  top: 43%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #dde4e1;
  border-radius: 50%;
  background: #fff;
  color: #176c59;
  box-shadow: 0 4px 14px rgba(27, 54, 46, .14);
}

.project-carousel-arrow.previous { left: -19px; }
.project-carousel-arrow.next { right: -19px; }
.project-carousel-arrow svg { width: 18px; height: 18px; }
.project-carousel-arrow:disabled { visibility: hidden; opacity: 0; pointer-events: none; }

@media (max-width: 1179px) and (min-width: 761px) {
  .chat .project-grid .project-card {
    flex-basis: calc((100% - 28px) / 3);
    width: calc((100% - 28px) / 3);
  }
}

@media (max-width: 760px) {
  .chat .message.has-projects,
  .chat .message.has-projects .message-content {
    width: 100%;
    max-width: 100%;
  }

  .project-results { margin-top: 16px; }
  .project-carousel-arrow { display: none; }
  .chat .project-grid { gap: 10px; padding-right: 10px; }
  .chat .project-grid .project-card {
    flex: 0 0 min(84vw, 300px);
    width: min(84vw, 300px);
  }
  .chat .project-card .property-media { aspect-ratio: 16 / 9; }
  .project-card-body { min-height: 160px; padding: 12px 13px 7px; }
}
