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

* {
  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: 58px;
  height: 40px;
  padding: 0;
}

.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;
  }
}

/* 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;
}

.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;
  }
}
