:root {
  color-scheme: light;
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #faf8f3;
  --panel: #ffffff;
  --panel-soft: #f2f0ea;
  --text: #1a2230;
  --muted: #6f766f;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #c8a961;
  --accent-soft: rgba(200, 169, 97, 0.14);
  --blue: #2563eb;
  --price: #b42318;
  --shadow: none;
  --ink: #1a2230;
  --gold: #c8a961;
  --gold-bright: #d9b871;
  --gold-border: rgba(200, 169, 97, 0.35);
  --warm-white: #f5f2ec;
  --warm-muted: #e8e4db;
  --slate-text-1: #9aa3b0;
  --slate-text-2: #8a93a2;
  --trend-green: #5fd0a0;
  --trend-red: #f08c7c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
}

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

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 16px;
  max-width: 1680px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: min(560px, 100%);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.topbar p,
.pane-header p,
small {
  color: var(--muted);
}

.dataset-tabs {
  display: flex;
  gap: 8px;
  max-width: 1680px;
  margin: 0 auto 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.dataset-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.dataset-tab:hover {
  border-color: #9fb3c8;
  background: #fafdff;
}

.dataset-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #0b5f58;
}

#searchInput {
  width: min(420px, 100%);
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.workspace {
  display: grid;
  grid-template-columns: 260px 380px minmax(0, 1fr);
  gap: 14px;
  max-width: 1680px;
  margin: 0 auto;
}

.pane {
  min-height: calc(100vh - 150px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.pane-header > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e8edf3;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.detail-heading {
  align-items: flex-start;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 206px);
  overflow: auto;
  padding: 10px;
}

.grid-list {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
}

.list-item,
.model-item {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.list-item span,
.model-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.list-item b {
  font-size: 13px;
  color: var(--blue);
}

.model-item {
  padding: 12px;
}

.model-item span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.list-item:hover,
.model-item:hover {
  border-color: #9fb3c8;
  background: #fafdff;
}

.list-item.active,
.model-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.empty,
.table-empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.table-wrap {
  max-height: calc(100vh - 438px);
  overflow: auto;
}

.model-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.model-charts:empty {
  display: none;
}

.specs-section {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.specs-section[hidden] {
  display: none;
}

.specs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafdff;
}

.specs-header h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.specs-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.specs-header > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e8edf3;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.specs-table-wrap {
  max-height: 260px;
  overflow: auto;
}

.specs-table {
  min-width: 1120px;
}

.specs-table td:nth-child(3),
.specs-table td:nth-child(4),
.specs-table td:nth-child(5),
.specs-table td:nth-child(6),
.specs-table td:nth-child(7) {
  white-space: nowrap;
}

.muted-cell {
  color: var(--muted);
}

.mini-chart {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  overflow: hidden;
}

.mini-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef3f8;
}

.mini-chart-header h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}

.mini-chart-header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(54px, 1fr);
  align-items: end;
  gap: 8px;
  height: 190px;
  overflow-x: auto;
  padding: 12px;
}

.mini-bar-wrap {
  display: grid;
  grid-template-rows: 20px 1fr auto auto;
  gap: 5px;
  min-width: 54px;
  height: 100%;
  text-align: center;
}

.mini-bar-value {
  color: var(--price);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-bar-track {
  display: flex;
  align-items: flex-end;
  min-height: 96px;
  border-left: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  background: linear-gradient(180deg, rgba(238, 243, 248, 0.3), rgba(238, 243, 248, 0.9));
}

.mini-bar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
}

.mini-bar-label {
  color: #344054;
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-bar-wrap small {
  font-size: 10px;
}

.chart-empty {
  color: var(--muted);
  padding: 28px 12px;
  text-align: center;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3f8;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

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

td a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.title-cell {
  min-width: 300px;
}

.title-cell small {
  display: block;
  margin-top: 4px;
}

.price-cell {
  color: var(--price);
  font-weight: 800;
  white-space: nowrap;
}

.chart-page {
  max-width: 1180px;
  margin: 0 auto;
}

.dataset-tabs.chart-page {
  margin-bottom: 14px;
}

.chart-pane {
  min-height: calc(100vh - 150px);
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 210px minmax(180px, 1fr) 86px;
  align-items: center;
  gap: 14px;
  min-height: 48px;
}

.bar-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.bar-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-meta span {
  color: var(--price);
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #eef3f8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.bar-row small {
  text-align: right;
  white-space: nowrap;
}

.assistant-shell {
  max-width: 720px;
  margin: 0 auto;
}

.assistant-shell:has(#intentGate[hidden]) {
  max-width: 936px;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 auto 16px;
  padding: 0 2px;
  text-align: left;
}

.assistant-shell:has(#intentGate:not([hidden])) {
  display: grid;
  align-content: center;
  min-height: 100vh;
}

.assistant-shell:has(#intentGate:not([hidden])) .brand-header {
  justify-content: center;
  gap: 28px;
  margin: 0 auto 34px;
  padding: 0;
  transform: translateX(-0.175em);
}

.assistant-shell:has(#intentGate:not([hidden])) .brand-identity {
  align-items: flex-end;
  gap: 22px;
}

.assistant-shell:has(#intentGate:not([hidden])) .brand-mark {
  width: clamp(142px, 21.6vw, 214px);
  height: clamp(142px, 21.6vw, 214px);
  border-radius: 0;
}

.assistant-shell:has(#intentGate:not([hidden])) .brand-header h1 {
  min-height: clamp(54px, 9vw, 86px);
  min-width: 3.8em;
  font-size: clamp(48px, 8vw, 84px);
}

.assistant-shell:has(#intentGate:not([hidden])) .brand-header p {
  margin-top: 8px;
  font-size: 16px;
}

.assistant-shell:has(#intentGate:not([hidden])) .freshness-pill {
  display: none;
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  width: 67px;
  height: 67px;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-header h1 {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-start;
  min-height: 23px;
  color: var(--text);
  font-family: "Source Sans Pro", "Source Sans 3", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.brand-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.header-status {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.freshness-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(95, 208, 160, 0.13);
  color: #287c5c;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.user-menu {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.user-menu button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.user-menu button:hover {
  border-color: var(--accent);
  color: #7a4a24;
}

.user-menu button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.brand-letter-b {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  transform: translateY(0.16em) scale(0.72) rotate(-8deg);
  transform-origin: center;
  overflow: hidden;
  color: #7a4a24;
  animation: seyfiAbiLetter 7s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.assistant-shell.compact-brand .brand-header {
  margin: 0 auto 14px;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 936px;
  margin: 0 auto 14px;
  overflow-x: auto;
  padding: 0 2px 2px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-item:not(:last-child)::after {
  color: var(--muted);
  content: "/";
}

.breadcrumb-nav button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

.breadcrumb-nav button:hover,
.breadcrumb-nav button:focus-visible {
  color: var(--accent);
  outline: none;
}

.breadcrumb-nav [aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

@keyframes seyfiAbiLetter {
  0%,
  39% {
    max-width: 0;
    opacity: 0;
    transform: translateY(0.16em) scale(0.72) rotate(-8deg);
  }

  50% {
    max-width: 0.7em;
    opacity: 1;
    transform: translateY(-0.04em) scale(1.08) rotate(2deg);
  }

  62%,
  100% {
    max-width: 0.7em;
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.choice-gate,
.vehicle-type-gate {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.choice-gate button,
.vehicle-type-gate button {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.choice-gate button:hover,
.choice-gate button:focus-visible,
.vehicle-type-gate button:hover,
.vehicle-type-gate button:focus-visible {
  border-color: var(--accent);
  box-shadow: none;
  outline: none;
  transform: translateY(-1px);
}

.choice-gate button small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.intent-primary {
  background: var(--ink) !important;
  color: var(--warm-white) !important;
}

.intent-primary small {
  color: var(--slate-text-1) !important;
}

.choice-gate strong,
.choice-gate span,
.vehicle-type-gate strong,
.vehicle-type-gate span {
  display: block;
}

.choice-gate button > span,
.vehicle-type-gate button > span {
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-gate:not(.vehicle-type-gate) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-gate {
  align-content: center;
  min-height: auto;
}

.valuation-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  max-width: 936px;
  margin: 0 auto;
  padding: 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(242, 240, 234, 0.72);
}

.valuation-pane,
.valuation-summary-pane {
  min-height: auto;
}

.small-action {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.small-action:hover,
.small-action:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.valuation-form {
  display: grid;
  gap: 12px;
  padding: 1rem 1.1rem;
}

.valuation-form label {
  display: grid;
  gap: 7px;
}

.valuation-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.valuation-form select,
.valuation-form input {
  width: 100%;
  min-height: 44px;
  border: 0.5px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--panel-soft);
  color: var(--text);
  outline: none;
  font-weight: 500;
}

.valuation-form select:focus,
.valuation-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.valuation-form select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.optional-filters {
  display: grid;
  gap: 14px;
  padding-top: 2px;
}

.optional-filters[hidden] {
  display: none;
}

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

.primary-action {
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 850;
}

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

.selection-summary {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  background: var(--ink);
  color: var(--warm-white);
}

.selection-summary dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.selection-summary div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.selection-summary dt {
  color: var(--slate-text-1);
  font-size: 12px;
  font-weight: 400;
}

.selection-summary dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.valuation-result {
  display: grid;
  gap: 16px;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--gold-border);
  border-radius: 12px 12px 0 0;
  background: var(--ink);
  color: var(--warm-white);
  font-variant-numeric: tabular-nums;
}

.valuation-result > strong {
  font-size: 16px;
  color: var(--warm-white);
}

.valuation-result > span,
.valuation-result p {
  color: var(--slate-text-1);
  font-size: 13px;
}

.result-label {
  color: var(--slate-text-1);
  font-size: 12px;
}

.result-price {
  color: var(--gold-bright);
  font-size: 38px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.range-wrap {
  display: grid;
  gap: 8px;
}

.range-edge-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
}

.range-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.range-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  transform: translate(-50%, -50%);
  transition: left 320ms ease;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--slate-text-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.range-labels > span {
  display: grid;
  gap: 2px;
}

.range-labels > span:last-child {
  justify-items: end;
}

.range-labels strong {
  color: var(--gold);
  font-weight: 500;
}

.valuation-result.is-updating .result-price,
.valuation-result.is-updating .range-labels {
  animation: valueRefresh 360ms ease;
}

@keyframes valueRefresh {
  from {
    opacity: 0.45;
    transform: translateY(6px);
  }

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

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 936px;
  margin: 0 auto;
}

.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.recent-listing-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chat-pane {
  min-height: calc(100vh - 118px);
}

.chat-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 258px);
  overflow: auto;
  padding: 16px;
  background: #fff;
}

.chat-message {
  max-width: min(760px, 92%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
}

.chat-message.user {
  align-self: flex-end;
  border-color: #b8d8d3;
  background: var(--accent-soft);
  color: #111;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message.pending {
  min-width: 76px;
}

.chat-message-author {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chat-message-author img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.chat-message-author strong {
  color: #4a3826;
  font: inherit;
}

.chat-message.user .chat-message-author {
  justify-content: flex-end;
  color: #111;
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
  animation: typingDot 1s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 140ms;
}

.typing-dots span:nth-child(3) {
  animation-delay: 280ms;
}

@keyframes typingDot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chat-message.user p {
  color: #111;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}

.chat-form textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  outline: none;
}

.chat-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chat-form button {
  min-height: 42px;
  align-self: end;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.chat-form button:disabled,
.chat-form textarea:disabled {
  cursor: wait;
  opacity: 0.65;
}

.prediction-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.empty-card {
  color: var(--muted);
}

.prediction-price {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.prediction-price span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.prediction-price strong {
  color: var(--price);
  font-size: 30px;
  line-height: 1.1;
}

.prediction-grid {
  display: grid;
  gap: 10px;
  margin: 0;
}

.prediction-grid div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.prediction-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.prediction-grid dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.prediction-warnings {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px 12px 12px 28px;
  border: 1px solid #f8d7a8;
  border-radius: 8px;
  background: #fff8eb;
  color: #8a4b0f;
  font-size: 13px;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(26, 34, 48, 0.28);
  backdrop-filter: blur(8px);
}

.auth-modal {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid rgba(200, 169, 97, 0.36);
  border-radius: 12px;
  padding: 24px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(26, 34, 48, 0.2);
  animation: auth-modal-in 240ms ease-out both;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 34px;
  margin-bottom: 20px;
}

.auth-modal-header h2 {
  margin-bottom: 5px;
  font-family: "Source Sans 3", var(--font-sans, sans-serif);
  font-size: 24px;
  font-weight: 700;
}

.auth-modal-header p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.auth-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
}

.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.auth-close:hover {
  border-color: var(--accent);
  color: var(--text);
}

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

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-name-field {
  opacity: 0;
  transform: translateY(-8px);
}

.auth-name-field.is-revealed {
  animation: auth-name-reveal 220ms ease-out both;
}

.auth-form input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-form button {
  min-height: 48px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.auth-form button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-form .auth-secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.auth-message {
  min-height: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-message[data-tone="success"] {
  color: #177245;
}

.auth-message[data-tone="error"] {
  color: #b42318;
}

.auth-message[data-tone="dev"] {
  color: #8a4b0f;
}

@keyframes auth-modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }

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

@keyframes auth-name-reveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

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

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 220px 300px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .workspace {
    display: flex;
    flex-direction: column;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .pane {
    min-height: auto;
  }

  .list,
  .specs-table-wrap,
  .table-wrap {
    max-height: none;
  }

  .model-charts {
    grid-template-columns: 1fr;
  }

  .mini-chart-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .bar-row small {
    text-align: left;
  }

  .assistant-layout {
    grid-template-columns: 1fr;
  }

  .valuation-layout {
    grid-template-columns: 1fr;
  }

  .valuation-pane,
  .valuation-summary-pane {
    min-height: auto;
  }

  .choice-gate:not(.vehicle-type-gate),
  .vehicle-type-gate {
    grid-template-columns: 1fr;
  }

  .brand-header {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 6px;
  }

  .header-status {
    justify-items: start;
  }

  .breadcrumb-nav {
    max-width: 100%;
  }

  .assistant-shell:has(#intentGate:not([hidden])) .brand-header {
    align-items: center;
    gap: 18px;
    text-align: center;
  }

  .assistant-shell:has(#intentGate:not([hidden])) .brand-identity {
    align-items: center;
    flex-direction: column;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .chat-pane {
    min-height: auto;
  }

  .chat-messages {
    max-height: 60vh;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-form button {
    min-height: 46px;
  }
}

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

  .valuation-layout {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .valuation-pane {
    margin-bottom: 14px;
  }

  .valuation-summary-pane {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 20;
    max-height: 68vh;
    min-height: 0;
    border-color: var(--gold-border);
    border-radius: 12px;
    background: var(--ink);
    overflow: auto;
  }

  .valuation-summary-pane .pane-header {
    display: none;
  }

  .valuation-result {
    border-width: 0 0 1px;
    border-radius: 12px 12px 0 0;
  }

  .selection-summary {
    max-height: 150px;
    overflow: auto;
  }

  .result-price {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #161a20;
    --panel: #20262e;
    --panel-soft: #252b34;
    --text: #f5f2ec;
    --muted: #a8afa6;
    --line: rgba(255, 255, 255, 0.12);
  }

  .valuation-layout {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .choice-gate button,
  .vehicle-type-gate button,
  .small-action {
    background: var(--panel);
  }
}
