:root {
  --ink: #24302b;
  --muted: #6f756f;
  --line: #e5ddd2;
  --line-strong: #d4cbbf;
  --surface: #fffdf9;
  --page: #f3efe8;
  --soft: #f7f3ec;
  --teal: #2f5d4e;
  --teal-strong: #24302b;
  --blue: #5e6b64;
  --blue-soft: #f3eee6;
  --coral: #8d5b4a;
  --coral-soft: #f8efe9;
  --amber: #8a7044;
  --amber-soft: #f8f1e4;
  --green: #3d684f;
  --shadow: 0 1px 0 rgba(36, 48, 43, 0.03);
  --shadow-soft: none;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(880px 380px at 0% -8%, rgba(141, 91, 74, 0.07), transparent 62%),
    radial-gradient(720px 420px at 100% 0%, rgba(47, 93, 78, 0.06), transparent 58%),
    var(--page);
  font-family: "Be Vietnam Pro", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid transparent;
  background: transparent;
}

.brand,
.top-actions,
.section-heading,
.panel-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  color: var(--ink);
  background: #efe8dc;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand h1,
.section-heading h2,
.factor-box h3,
.project-info-header h2,
.auth-header h2 {
  margin: 0;
  font-weight: 500;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 1.16rem;
  font-weight: 500;
  line-height: 1.15;
}

.brand p,
.section-heading p,
.result-meta,
#chatHistoryMeta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.top-actions {
  justify-content: flex-end;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 500;
}

.status-wait {
  color: #73581c;
  background: #fff1c4;
}

.status-ok {
  color: #155b34;
  background: #dff2e5;
}

.status-bad {
  color: #8b342a;
  background: #ffe2dc;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  grid-template-areas:
    "form info"
    "comps comps";
  gap: 22px;
  width: min(1440px, calc(100% - 48px));
  margin: 28px auto 56px;
}

.surface {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.form-panel {
  grid-area: form;
  align-self: start;
}

.chat-panel {
  grid-area: chat;
  display: none;
}

.comps-panel {
  grid-area: comps;
}

.section-heading {
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.section-heading h2 {
  font-size: 1.02rem;
  line-height: 1.2;
}

#result-panel > .section-heading {
  align-items: flex-start;
  flex-direction: column;
}

#result-panel > .section-heading .eyebrow {
  display: none;
}

#resultMeta {
  max-width: 72ch;
  line-height: 1.45;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.panel-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 13px;
  white-space: nowrap;
  font-weight: 500;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.icon-button:hover,
.primary-button:hover {
  border-color: var(--line-strong);
}

.icon-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon-button.icon-only {
  width: 38px;
  padding: 0;
}

.icon-button {
  color: var(--ink);
  border-color: var(--line);
  background: #fffdf9;
}

.icon-button.secondary {
  color: var(--teal-strong);
  background: var(--soft);
}

.auth-button {
  max-width: min(320px, 46vw);
}

.auth-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-button.is-authenticated {
  color: #155b34;
  border-color: #b7dcc5;
  background: #e7f6ec;
}

.icon-button.ghost {
  color: var(--blue);
  background: var(--blue-soft);
}

.icon-button.danger {
  color: #8a3429;
  border-color: #f0c7bd;
  background: var(--coral-soft);
}

.primary-button {
  color: #f7f3ec;
  background: var(--ink);
  border-radius: 999px;
}

.primary-button:hover {
  background: #1b2621;
  border-color: transparent;
}

.full-width {
  width: 100%;
}

.auth-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(36, 48, 43, 0.32);
  cursor: default;
}

.auth-panel {
  position: relative;
  width: min(100%, 430px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
  box-shadow: 0 24px 60px rgba(36, 48, 43, 0.16);
}

.auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fffdf9;
}

.auth-header h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 18px 0;
}

.auth-mode-tabs button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f7f3ec;
  font-weight: 500;
}

.auth-mode-tabs button.is-active {
  color: #fffdf9;
  border-color: var(--teal);
  background: var(--teal);
}

.auth-form,
.auth-session-summary {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--ink);
  background: #fffdf9;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 93, 78, 0.16);
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 500;
}

.auth-message.is-error {
  color: #8a3429;
}

.auth-session-summary {
  padding-top: 18px;
}

.auth-session-summary strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.auth-session-summary small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.valuation-form {
  padding: 16px 18px 18px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #f7f3ec;
  font-weight: 600;
}

.segmented input:checked + span {
  color: #f7f3ec;
  border-color: var(--ink);
  background: var(--ink);
}

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

.field-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.field-grid label span,
.label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.valuation-form input,
.valuation-form select,
.chat-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fffdf9;
  outline: none;
}

.segmented input {
  width: 1px;
  height: 1px;
  min-height: 1px;
}

.valuation-form input,
.valuation-form select {
  padding: 0 10px;
}

.valuation-form input:focus,
.valuation-form select:focus,
.chat-form textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 93, 78, 0.16);
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.95fr) minmax(220px, 1fr);
  gap: 12px;
  padding: 16px 18px 12px;
}

.estimate-focus {
  display: grid;
  align-content: end;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px 20px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.4), rgba(255, 253, 249, 0)),
    #f7f3ec;
}

.estimate-focus span,
.metric span {
  display: block;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 500;
}

.estimate-focus .metric-label,
.metric .metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-tooltip {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0;
  color: var(--teal-strong);
  background: #fffdf9;
}

.estimate-focus .info-tooltip {
  color: var(--muted);
  border-color: var(--line);
  background: #fffdf9;
}

.info-tooltip svg {
  width: 14px;
  height: 14px;
}

.estimate-focus strong {
  display: block;
  margin-top: 10px;
  font-family: Fraunces, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 2.9rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.estimate-focus strong.is-pending,
.metric strong.is-pending {
  color: var(--muted);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fffdf9;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.24rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.chart-area {
  height: 220px;
  margin: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
}

.chart-area canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 18px;
}

.signal-grid div {
  min-width: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--soft);
}

.signal-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 12px;
}

.summary-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fffdf9;
}

.summary-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.summary-chart-area {
  height: 280px;
  margin: 0 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
}

.summary-chart-area canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.evaluation-notes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 18px 18px 36px;
  color: var(--muted);
  line-height: 1.45;
}

.data-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 12px;
  padding-bottom: 18px;
}

.map-preview {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-right: 18px;
}

.map-preview-heading {
  display: grid;
  gap: 4px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fffdf9;
}

.map-preview-heading strong {
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.factor-box {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fffdf9;
}

.factor-box h3 {
  font-size: 0.92rem;
}

.factor-box ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.45;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 360px;
  overflow: auto;
  padding: 18px;
  background: #f7f3ec;
  scrollbar-color: #d4cbbf transparent;
}

.message {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0;
}

.message.user {
  grid-template-columns: 1fr 34px;
}

.message p,
.message .bubble,
.message ul {
  margin: 0;
}

.message .bubble,
.message p {
  min-width: 0;
  width: min(100%, 660px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px 10px;
  color: var(--ink);
  background: #fffdf9;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.message.user .bubble,
.message.user p {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  border-color: var(--line-strong);
  background: #f3eee6;
}

.message.user .avatar {
  grid-column: 2;
  grid-row: 1;
  color: var(--ink);
  background: #efe8dc;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  color: #fffdf9;
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
}

.message .bubble .response-prose {
  margin: 0 0 8px;
  border: 0;
  padding: 0;
  width: auto;
  background: transparent;
  white-space: pre-line;
}

.message .bubble .response-prose:last-child,
.message .bubble .response-list:last-child {
  margin-bottom: 0;
}

.response-list {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.response-list li {
  position: relative;
  padding-left: 16px;
}

.response-list li::before {
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--teal);
  content: "";
}

.message-meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.chat-intro {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 15px;
  color: var(--muted);
  background: #fffdf9;
  line-height: 1.45;
}

.chat-intro strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.prompt-chips button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--teal-strong);
  background: #f3eee6;
  font-size: 0.82rem;
  font-weight: 500;
}

.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 0;
  list-style: none;
}

.missing-list li {
  border-radius: 999px;
  padding: 5px 8px;
  color: #7a3b22;
  background: #ffe7d8;
  font-size: 0.82rem;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  background: #fffdf9;
}

.chat-form textarea {
  min-height: 54px;
  max-height: 160px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.45;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 18px;
}

.trend-cell {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fffdf9;
}

.trend-cell span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.trend-cell strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--green);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.trend-cell small {
  color: var(--muted);
  line-height: 1.35;
}

.table-wrap {
  overflow: auto;
  padding: 0 18px 18px;
}

.map-frame {
  display: block;
  width: calc(100% - 36px);
  height: 420px;
  margin: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf9;
}

.map-link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 9px;
  color: var(--teal-strong);
  background: var(--blue-soft);
  font-size: 0.8rem;
  font-weight: 500;
}

.map-link-button svg {
  width: 15px;
  height: 15px;
}

.amenity-advice-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 18px 14px 36px;
  color: var(--ink);
  line-height: 1.45;
}

.amenity-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px 12px;
}

.amenity-highlight {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fffdf9;
}

.amenity-highlight span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.amenity-highlight strong {
  display: block;
  margin-top: 6px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.amenity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.amenity-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fffdf9;
}

.amenity-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.amenity-card-title strong {
  font-size: 0.92rem;
}

.amenity-card p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.amenity-place-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.amenity-place-list li {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.amenity-place-list a {
  color: var(--teal-strong);
  font-weight: 500;
  text-decoration: none;
}

.amenity-place-list small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  min-height: 64px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: var(--muted);
  background: #fffdf9;
}

.loading-state::before {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--teal-strong);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  content: "";
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

td {
  color: var(--ink);
  line-height: 1.4;
}

td a {
  color: var(--teal-strong);
  font-weight: 500;
  text-decoration: none;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: #fffdf9;
}

.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.assistant-widget {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 70;
  width: min(840px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 116px));
  min-height: 420px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 50px rgba(36, 48, 43, 0.14);
  overflow: hidden;
  animation: assistant-widget-in 0.18s ease;
}

.assistant-widget.is-parked {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.assistant-widget iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--page);
}

.chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 72;
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: 60px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  overflow: hidden;
  color: var(--ink);
  background: #fffdf9;
  box-shadow: 0 10px 28px rgba(36, 48, 43, 0.08);
  font-weight: 500;
}

.chat-launcher-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
}

.chat-launcher:hover,
.chat-launcher:focus-visible,
.chat-launcher.is-open {
  width: auto;
  gap: 8px;
  padding-right: 16px;
  background: #fffdf9;
  border-color: var(--line-strong);
}

.chat-launcher:hover .chat-launcher-label,
.chat-launcher:focus-visible .chat-launcher-label,
.chat-launcher.is-open .chat-launcher-label {
  max-width: 8rem;
  opacity: 1;
}

.chat-launcher img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  object-position: center 28%;
}

@media (max-width: 1120px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-areas:
      "form"
      "info"
      "comps";
  }

  .trend-grid,
  .data-layout {
    grid-template-columns: 1fr;
  }

  .map-preview {
    padding: 0 18px;
  }
}

@media (max-width: 900px) {
  .amenity-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .dashboard {
    width: min(100% - 20px, 720px);
    gap: 12px;
    margin-top: 12px;
  }

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

  .panel-actions,
  .chat-form {
    width: 100%;
  }

  .panel-actions .icon-button,
  .chat-form .primary-button {
    flex: 1 1 auto;
  }

  .chat-form {
    display: flex;
    flex-direction: column;
  }

  .field-grid,
  .result-layout,
  .metric-strip,
  .signal-grid,
  .trend-grid,
  .summary-grid,
  .amenity-grid,
  .amenity-highlights {
    grid-template-columns: 1fr;
  }

  .estimate-focus {
    min-height: 112px;
  }

  .chart-area {
    height: 190px;
  }

  .summary-chart-area,
  .map-frame {
    width: calc(100% - 28px);
    margin-right: 14px;
    margin-left: 14px;
  }

  .map-preview .map-frame {
    width: 100%;
    margin: 0;
  }

  .map-frame {
    height: 340px;
  }

  .chat-log {
    height: 340px;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 760px) {
  .assistant-widget {
    right: 10px;
    left: 10px;
    bottom: 78px;
    width: auto;
    height: min(680px, calc(100vh - 94px));
    min-height: 360px;
  }

  .chat-launcher {
    right: 14px;
    bottom: 14px;
    width: 56px;
    height: 56px;
    padding: 3px;
  }

  .chat-launcher:hover,
  .chat-launcher:focus-visible,
  .chat-launcher.is-open {
    width: auto;
    padding-right: 14px;
  }
}

@keyframes assistant-widget-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* TABS SYSTEM */
.project-info-section {
  display: flex;
  flex-direction: column;
  grid-area: info;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-info-header {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  padding: 18px 22px 0;
  border-bottom: 0;
  background: transparent;
}

.project-info-header h2 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.2;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.tabs-nav::-webkit-scrollbar {
  height: 4px;
}
.tabs-nav::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

.tab-btn {
  white-space: nowrap;
  min-height: 36px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0 12px;
  background-color: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
}

.tab-btn:hover {
  background-color: transparent;
  color: var(--ink);
}

.tab-btn.active {
  background-color: transparent;
  color: var(--ink);
  border-color: transparent;
  border-bottom-color: var(--ink);
  box-shadow: none;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tabs-content {
  min-width: 0;
}

.map-preview .map-frame {
  width: 100%;
  height: 350px;
  margin: 0;
}

/* NEWS PANEL */
.news-grid {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.news-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: box-shadow 0.2s ease;
}

.news-card:hover {
  box-shadow: var(--shadow);
}

.news-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.05rem;
  color: var(--ink);
}

.news-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .news-meta {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.studio-note {
  margin: 0;
  padding: 16px 22px 0;
}

.studio-note img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.studio-note figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .project-info-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* Confidence Badge Colors */
.confidence-badge {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.1;
}

.confidence-badge.conf-high {
  color: #116239;
  background-color: #dff4e8;
}

.confidence-badge.conf-medium {
  color: #8a5a0a;
  background-color: #fff2bf;
}

.confidence-badge.conf-low {
  color: #9f2f26;
  background-color: #ffe0d9;
}
