:root {
  color-scheme: light;
  --canvas: #eef3f1;
  --surface: #fbfcfa;
  --surface-strong: #e4ebe7;
  --surface-muted: #d7e1dc;
  --ink: #17211f;
  --body: #35423f;
  --muted: #66736f;
  --hairline: #cbd6d1;
  --hairline-soft: #dde5e1;
  --accent: #087f73;
  --accent-active: #075f58;
  --accent-soft: #dff1ed;
  --signal: #d99a24;
  --signal-soft: #f5ebd4;
  --good: #167557;
  --warn: #a46a18;
  --danger: #9f442f;
  --danger-soft: #f3e0db;
  --shadow: rgba(23, 33, 31, 0.06) 0 1px 2px, rgba(23, 33, 31, 0.08) 0 8px 24px;
  font-family: Inter, Circular, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
}

.auth-gate {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  padding: 22px;
}

.auth-wordmark {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.auth-loading {
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 18px;
  width: min(100%, 380px);
  padding: 24px;
}

.auth-loading-copy {
  display: grid;
  gap: 6px;
}

.auth-loading-copy p {
  margin: 0;
  color: var(--accent-active);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-loading-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.08;
}

.auth-loading-copy span {
  color: var(--body);
  font-size: 0.92rem;
  font-weight: 680;
  line-height: 1.4;
}

.loading-bar {
  position: relative;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.loading-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: var(--accent);
  animation: loading-sweep 1.15s ease-in-out infinite;
}

@keyframes loading-sweep {
  0% {
    transform: translateX(-105%);
  }
  100% {
    transform: translateX(245%);
  }
}

.auth-card {
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 14px;
  width: min(100%, 390px);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 1.05;
}

.auth-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  color: var(--body);
  outline: 0;
}

.auth-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(244, 248, 246, 0.96);
  backdrop-filter: blur(16px);
}

.top-left-actions {
  display: inline-flex;
  grid-column: 1;
  min-width: 0;
  align-items: center;
  justify-self: start;
  gap: 14px;
}

.brand-lockup {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.wordmark {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-pill {
  display: grid;
  grid-template-columns: 1.45fr 1fr 72px 82px;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.search-pill label {
  display: grid;
  gap: 3px;
  padding: 0 16px;
  border-right: 1px solid var(--hairline-soft);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
}

.search-pill input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--body);
  font-size: 0.9rem;
}

.search-pill button {
  width: 70px;
  height: 42px;
  margin: 6px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.top-chat-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px;
}

.top-chat-form span {
  border-right: 1px solid var(--hairline-soft);
  padding: 0 10px;
  color: var(--accent-active);
  font-size: 0.78rem;
  font-weight: 850;
}

.top-chat-form input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--body);
  font-size: 0.95rem;
}

.top-chat-form button {
  min-width: 72px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 850;
}

.top-chat-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.top-metrics {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  white-space: nowrap;
}

.top-metrics::-webkit-scrollbar {
  display: none;
}

.top-workspace-controls {
  display: grid;
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  width: min(820px, 60vw);
  max-width: 100%;
  min-width: 0;
  align-items: center;
  justify-self: center;
  gap: 8px;
}

.top-workspace-controls .workspace-switcher {
  grid-column: 2;
  flex: 0 1 auto;
  justify-self: center;
}

.top-workspace-controls .workspace-filter-panel {
  grid-column: 3;
  flex: 0 0 auto;
  justify-self: start;
}

.app-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.72);
  padding: 3px;
}

.app-switcher button {
  min-height: 32px;
  border-radius: 6px;
  background: transparent;
  padding: 0 11px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.app-switcher button.active {
  background: var(--ink);
  color: #ffffff;
}

.top-right-actions {
  display: inline-flex;
  grid-column: 3;
  min-width: 0;
  align-items: center;
  justify-self: end;
  gap: 10px;
}

.status,
.auth-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 10px;
  color: var(--body);
  font-size: 0.78rem;
  font-weight: 750;
}

.top-metrics span {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.74);
  padding: 0 10px;
  color: var(--body);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.top-metrics .metric-today {
  border-color: rgba(8, 127, 115, 0.24);
  background: var(--accent-soft);
  color: var(--accent-active);
}

.top-metrics .metric-alert {
  border-color: rgba(217, 154, 36, 0.28);
  background: var(--signal-soft);
  color: var(--warn);
}

.account-actions {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.account-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 32px;
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.74);
  padding: 0 10px;
  color: var(--body);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.account-actions .sync-status {
  border: 1px solid transparent;
  color: var(--accent-active);
}

.account-actions .sync-status.error {
  color: var(--danger);
}

.account-button {
  border: 1px solid var(--hairline);
}

.account-button:hover {
  border-color: var(--accent-active);
  color: var(--accent-active);
}

.auth-button {
  border: 1px solid var(--hairline);
}

.auth-button.primary {
  justify-content: center;
  min-height: 42px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.auth-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-form input {
  width: 180px;
  min-height: 30px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 10px;
  color: var(--body);
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-form small {
  max-width: 220px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button:not(:disabled):hover {
  border-color: var(--accent-active);
  color: var(--accent-active);
}

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

.onboarding-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 24px;
}

.onboarding-panel {
  display: grid;
  gap: 18px;
  width: min(100%, 1040px);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.onboarding-heading {
  display: grid;
  gap: 6px;
  max-width: 680px;
}

.onboarding-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.onboarding-heading h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.15;
}

.onboarding-heading span {
  color: var(--body);
  font-size: 0.92rem;
  font-weight: 680;
  line-height: 1.45;
}

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

.onboarding-card {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.onboarding-card.wide {
  grid-row: span 2;
}

.onboarding-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.onboarding-card-heading p,
.workspace-start-card p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.onboarding-card-heading h2,
.workspace-start-card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.2;
}

.segment.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
}

.profile-grid.compact {
  margin-top: 0;
}

.onboarding-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.district-picker {
  display: grid;
  gap: 10px;
}

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

.district-chip-group {
  display: grid;
  gap: 8px;
}

.district-chip-group > div {
  display: grid;
  gap: 6px;
}

.district-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.district-group-heading span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.district-group-heading button {
  min-height: 26px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 820;
}

.district-group-heading button:disabled {
  cursor: default;
  opacity: 0.45;
}

.district-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.district-chip {
  min-height: 30px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-active);
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 820;
  text-align: left;
}

.district-chip.exclude {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.district-chip.muted {
  border-color: var(--hairline);
  background: var(--surface-strong);
  color: var(--muted);
}

.workspace-start-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}

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

.workspace-choice {
  display: grid;
  gap: 6px;
  min-height: 96px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  text-align: left;
}

.workspace-choice.primary {
  border-color: var(--accent-active);
  background: var(--accent-soft);
}

.workspace-choice strong {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
}

.workspace-choice span {
  color: var(--body);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.workspace-choice:disabled {
  cursor: wait;
  opacity: 0.62;
}

.onboarding-warning {
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 800;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: auto;
  background: rgba(23, 33, 31, 0.34);
  padding: 28px 18px;
}

.listing-import-dialog {
  display: grid;
  gap: 14px;
  width: min(100%, 760px);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dialog-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 1.24rem;
}

.dialog-actions {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.dialog-actions span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dialog-actions.submit {
  padding-top: 4px;
}

.sync-status {
  color: var(--accent-active);
}

.sync-status.error {
  color: var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: 380px minmax(560px, 1fr) 430px;
  gap: 18px;
  padding: 18px 24px 28px;
  animation: workspace-enter 260ms ease-out both;
}

.left-rail {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
  align-content: stretch;
  gap: 18px;
  animation: chat-rail-enter 300ms ease-out both;
}

.left-rail.has-profile {
  grid-template-rows: auto minmax(360px, 1fr) auto;
}

.right-rail {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 0;
  animation: results-enter 360ms ease-out both;
}

.results {
  animation: results-enter 320ms ease-out both;
}

@keyframes workspace-enter {
  from {
    opacity: 0.66;
  }

  to {
    opacity: 1;
  }
}

@keyframes chat-rail-enter {
  from {
    opacity: 0.72;
    transform: translateX(18px);
  }

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

@keyframes results-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media (prefers-reduced-motion: reduce) {
  .workspace,
  .left-rail,
  .results,
  .right-rail {
    animation: none;
  }
}

.profile-panel,
.chat-panel,
.saved-search-panel,
.detail-panel {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
}

.profile-panel,
.chat-panel,
.saved-search-panel,
.detail-content {
  padding: 18px;
}

.panel-heading,
.profile-summary,
.section-title,
.detail-header,
.ratio-heading,
.card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading p,
.profile-summary p,
.section-title p,
.detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.panel-heading button,
.panel-heading span,
.profile-summary > span {
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 7px 10px;
  color: var(--body);
  font-size: 0.78rem;
  font-weight: 750;
}

.profile-details {
  padding: 18px;
}

.profile-summary {
  cursor: pointer;
  list-style: none;
}

.profile-details[open] .profile-summary {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline-soft);
  padding-bottom: 14px;
}

.profile-summary::-webkit-details-marker {
  display: none;
}

.profile-summary h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.25;
}

.summary-warning {
  display: block;
  margin-top: 8px;
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.profile-editor-body {
  margin-top: 16px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 16px;
}

.profile-section {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.scenario-section {
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
}

.profile-section h2,
.section-title h1,
.detail-header h2 {
  margin: 0;
  font-weight: 650;
  letter-spacing: 0;
}

.profile-section h2 {
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-active);
  font-size: 0.82rem;
  font-weight: 850;
}

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

.segment button,
.filter-row button,
.action-row button,
.reason-row button {
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 780;
}

.segment button.active,
.filter-row button.active {
  border-color: var(--accent-active);
  background: var(--accent-active);
  color: #ffffff;
}

.filter-row button {
  min-height: 30px;
  background: rgba(251, 252, 250, 0.72);
  padding: 5px 9px;
  color: var(--body);
  font-size: 0.72rem;
}

.filter-row button.active {
  border-color: rgba(8, 127, 115, 0.28);
  background: var(--accent-soft);
  color: var(--accent-active);
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--body);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.3;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

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

.profile-grid.partner {
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
}

.input-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.input-field.invalid {
  color: var(--danger);
}

.required-mark {
  justify-self: start;
  border-radius: 6px;
  background: var(--danger-soft);
  padding: 3px 6px;
  color: var(--danger);
  font-size: 0.68rem;
  font-weight: 850;
}

.input-field input,
.input-field select,
.input-field textarea,
.chat-form input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
}

.input-field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

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

.input-field.invalid input {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.field-error {
  margin: 10px 0 0;
  border-radius: 8px;
  background: var(--danger-soft);
  padding: 10px 12px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
}

.places-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 14px;
}

.places-heading,
.place-editor-heading,
.place-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.places-heading strong {
  font-size: 0.92rem;
}

.places-heading span,
.place-toggle {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.place-editor {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 10px;
}

.place-editor:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.place-toggle {
  justify-content: flex-start;
}

.place-editor-heading button,
.add-place-button {
  min-height: 30px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 820;
}

.add-place-button {
  justify-self: start;
}

.add-place-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.place-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.place-fields {
  display: grid;
  grid-template-columns: 1.15fr 0.8fr 0.85fr;
  gap: 8px;
}

.place-fields .input-field {
  font-size: 0.7rem;
}

.place-fields .input-field input {
  padding: 8px 9px;
}

.place-status {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
  margin: 0;
}

.place-status.needs-postal {
  color: #a05c20;
}

.ratio-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.ratio-card.scenario {
  background: var(--signal-soft);
}

.ratio-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.funding-gap {
  display: grid;
  gap: 4px;
  border-top: 1px solid rgba(8, 127, 115, 0.22);
  padding-top: 10px;
}

.funding-gap span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.funding-gap strong {
  color: var(--accent-active);
  font-size: 1.05rem;
}

.funding-gap.open-mode strong {
  color: var(--warn);
}

.ratio-heading span,
.ratio div:first-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.ratio {
  display: grid;
  gap: 6px;
}

.ratio div:first-child {
  display: flex;
  justify-content: space-between;
}

.ratio-track {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-muted);
}

.ratio-track span {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--good);
}

.ratio-track.warn span {
  background: var(--warn);
}

.ratio-track.danger span {
  background: var(--danger);
}

.primary-chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 420px;
}

.empty-chat-workspace {
  display: grid;
  min-height: calc(100vh - 76px);
  place-items: center;
  padding: 34px 24px;
}

.empty-chat-shell {
  display: grid;
  gap: 16px;
  width: min(100%, 780px);
}

.empty-chat-heading {
  display: grid;
  gap: 6px;
  text-align: center;
}

.empty-chat-heading p {
  margin: 0;
  color: var(--accent-active);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.empty-chat-heading h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.08;
}

.empty-chat-heading span {
  justify-self: center;
  max-width: 620px;
  color: var(--body);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.empty-chat-next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.empty-chat-next div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.empty-chat-next strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.empty-chat-next span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.35;
}

.empty-chat-panel {
  grid-template-rows: minmax(320px, 1fr) auto;
  min-height: min(58vh, 560px);
  box-shadow: var(--shadow);
}

.empty-chat-panel .messages {
  align-content: end;
}

.empty-chat-form {
  position: static;
}

.empty-chat-prompts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.empty-chat-prompts button {
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--body);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.empty-chat-prompts button:hover {
  border-color: var(--accent);
  color: var(--accent-active);
}

.primary-chat .messages {
  max-height: none;
  min-height: 0;
}

.messages {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin: 14px 0;
}

.message {
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--body);
  font-size: 0.86rem;
  line-height: 1.42;
}

.message-text {
  white-space: pre-wrap;
}

.message.has-cards {
  display: grid;
  gap: 10px;
}

.message.assistant {
  background: var(--surface);
}

.message.user {
  background: var(--accent-soft);
  justify-self: end;
  max-width: min(82%, 320px);
  padding: 5px 9px 3px;
  font-size: 0.82rem;
  line-height: 1.2;
}

.message.user .message-text {
  line-height: inherit;
}

.chat-rich-card {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 10px;
}

.chat-rich-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.chat-rich-heading strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.chat-rich-heading span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-rich-list {
  display: grid;
  gap: 7px;
}

.chat-rich-row,
.chat-memory-row {
  display: grid;
  min-width: 0;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: #ffffff;
  color: var(--body);
  padding: 9px;
  text-align: left;
}

.chat-rich-row {
  gap: 3px;
}

.chat-rich-row:hover,
.chat-memory-row:hover {
  border-color: var(--accent);
}

.chat-rich-row span,
.chat-memory-row span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.chat-rich-row strong,
.chat-memory-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-rich-row small,
.chat-memory-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-rich-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1.3;
}

.chat-memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 7px;
}

.chat-memory-row {
  gap: 4px;
  min-height: 88px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-form button {
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 16px;
  font-weight: 850;
}

.chat-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-chat-form {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 8px;
}

.saved-search-panel {
  display: grid;
  gap: 12px;
}

.saved-search-panel .panel-heading button {
  border: 1px solid var(--hairline);
}

.saved-search-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.saved-search-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.4;
}

.saved-search-list {
  display: grid;
  gap: 8px;
}

.saved-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.saved-search-row button {
  min-width: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.saved-search-row > button:first-child {
  display: grid;
  gap: 3px;
  text-align: left;
}

.saved-search-row > button:last-child {
  color: var(--muted);
  font-size: 0.72rem;
}

.saved-search-row strong,
.saved-search-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-search-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.saved-search-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-search-row small.stale {
  color: var(--warn);
}

.saved-search-row small.changed {
  color: var(--accent-active);
}

.saved-search-row.active > button:first-child {
  border-color: var(--accent-active);
  background: var(--accent-soft);
}

.results {
  min-width: 0;
}

.section-title {
  align-items: flex-start;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.section-title h1 {
  max-width: 720px;
  margin-top: 4px;
  font-size: 1.2rem;
  line-height: 1.18;
}

.filter-stack {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.workspace-filter-panel {
  position: relative;
  max-width: 100%;
  justify-self: end;
}

.workspace-filter-panel summary {
  display: inline-flex;
  max-width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.78);
  padding: 7px 10px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 850;
}

.workspace-filter-panel summary::-webkit-details-marker {
  display: none;
}

.workspace-filter-panel summary::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  opacity: 0.7;
}

.workspace-filter-panel[open] summary {
  border-color: rgba(8, 127, 115, 0.34);
  background: var(--accent-soft);
  color: var(--accent-active);
}

.workspace-filter-panel summary strong {
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  color: var(--body);
  font-size: 0.76rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-filter-panel[open] .filter-stack {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(31, 39, 36, 0.14);
  padding: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.filter-row > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.section-tools {
  display: grid;
  justify-items: end;
  gap: 9px;
}

.workspace-switcher {
  display: flex;
  max-width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.workspace-switcher::-webkit-scrollbar {
  display: none;
}

.workspace-switcher button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.78);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.workspace-switcher button.active {
  border-color: rgba(8, 127, 115, 0.34);
  background: var(--accent-soft);
  color: var(--accent-active);
}

.workspace-switcher button span {
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(8, 127, 115, 0.12);
  padding: 1px 6px;
  color: inherit;
  font-size: 0.68rem;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 18px;
}

.comparison-panel,
.today-panel,
.pipeline-panel,
.candidate-review-panel,
.report-panel {
  display: grid;
  gap: 16px;
}

.today-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.today-metric {
  display: grid;
  gap: 4px;
  min-height: 104px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.today-metric span,
.today-item span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 860;
  text-transform: uppercase;
}

.today-metric strong {
  color: var(--ink);
  font-size: 1.5rem;
}

.today-metric p,
.today-lane > p,
.today-item small {
  margin: 0;
  color: var(--body);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
}

.today-metric.alert,
.today-lane.alert {
  border-color: rgba(185, 28, 28, 0.22);
}

.today-metric.warn,
.today-lane.warn {
  border-color: rgba(180, 83, 9, 0.24);
}

.today-lanes,
.today-side {
  display: grid;
  gap: 12px;
}

.today-lane {
  display: grid;
  gap: 9px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 13px;
}

.today-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.today-item {
  display: grid;
  gap: 8px;
  min-height: 96px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
  text-align: left;
}

.today-item-main {
  display: grid;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.today-item-main:not(:disabled):hover {
  cursor: pointer;
}

.today-item:has(.today-item-main:not(:disabled):hover) {
  border-color: var(--accent);
}

.today-item-main:disabled {
  cursor: default;
  opacity: 0.74;
}

.today-item strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
}

.today-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 8px;
}

.today-item-actions button {
  min-height: 30px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 850;
}

.today-item-actions button:hover {
  border-color: var(--accent);
}

.today-empty {
  min-height: 112px;
}

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

.pipeline-action-strip button {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  text-align: left;
}

.pipeline-action-strip button:disabled {
  cursor: default;
  opacity: 0.72;
}

.pipeline-action-strip strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.pipeline-action-strip span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.35;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 10px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipeline-column {
  display: grid;
  gap: 10px;
  min-width: 210px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 10px;
}

.pipeline-column-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.pipeline-column-heading span {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.pipeline-column-heading p,
.pipeline-empty {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
}

.pipeline-column-heading strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.pipeline-column-list {
  display: grid;
  gap: 9px;
}

.pipeline-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
}

.pipeline-card.selected {
  border-color: var(--accent-active);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pipeline-card-main {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 9px;
  border: 0;
  background: transparent;
  padding: 9px;
  color: inherit;
  text-align: left;
}

.pipeline-thumb {
  position: relative;
  overflow: hidden;
  min-height: 66px;
  border-radius: 8px;
  background-color: var(--surface-strong);
  background-position: center;
  background-size: cover;
}

.pipeline-thumb span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  max-width: calc(100% - 10px);
  overflow: hidden;
  border-radius: 6px;
  background: rgba(251, 252, 250, 0.94);
  padding: 3px 5px;
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.pipeline-card-copy div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: baseline;
}

.pipeline-card-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card-copy div:first-child span {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
}

.pipeline-card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  line-height: 1.35;
}

.pipeline-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pipeline-chip-row span {
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 3px 6px;
  color: var(--body);
  font-size: 0.64rem;
  font-weight: 820;
}

.pipeline-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--hairline-soft);
  padding: 8px;
}

.pipeline-card-actions button {
  min-height: 28px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 5px 7px;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 850;
}

.candidate-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
}

.candidate-review-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.candidate-review-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
}

.candidate-review-card.selected {
  border-color: var(--accent-active);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.candidate-review-main {
  display: grid;
  grid-template-rows: 142px auto;
  min-width: 0;
  background: transparent;
  color: var(--body);
  padding: 0;
  text-align: left;
}

.candidate-review-photo {
  position: relative;
  min-height: 142px;
  background-position: center;
  background-size: cover;
}

.candidate-review-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.38));
}

.candidate-review-photo span,
.candidate-review-photo small {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 5px 8px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 850;
}

.candidate-review-photo span {
  left: 10px;
  top: 10px;
}

.candidate-review-photo small {
  right: 10px;
  top: 10px;
}

.candidate-review-copy {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.candidate-review-copy div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}

.candidate-review-copy strong,
.candidate-review-copy span {
  color: var(--ink);
  font-size: 0.88rem;
}

.candidate-review-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-review-copy span {
  font-weight: 850;
}

.candidate-review-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.35;
}

.candidate-review-copy .market-chip {
  color: var(--signal);
}

.candidate-review-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--hairline-soft);
  padding: 10px;
}

.candidate-review-actions button,
.candidate-review-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 7px;
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
}

.comparison-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.comparison-toolbar p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.comparison-toolbar h2 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.2;
}

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

.comparison-actions button {
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 7px 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 820;
}

.comparison-actions button:disabled {
  cursor: default;
  opacity: 0.48;
}

.copy-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 7px 10px;
  color: var(--accent-active);
  font-size: 0.76rem;
  font-weight: 850;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.report-metric,
.report-listing,
.handoff-packet,
.mortgage-panel {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
}

.report-metric {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.report-metric span,
.handoff-packet {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.report-metric strong {
  color: var(--ink);
  font-size: 1rem;
}

.report-metric p,
.report-listing p {
  margin: 0;
  color: var(--body);
  font-size: 0.8rem;
  line-height: 1.4;
}

.ranking-panel,
.next-action-panel {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 14px;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: start;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 11px;
  color: var(--ink);
  text-align: left;
}

.ranking-row:hover {
  border-color: var(--accent);
}

.ranking-row > span {
  grid-row: 1 / span 3;
  border-radius: 8px;
  background: var(--accent-soft);
  padding: 5px 7px;
  color: var(--accent-active);
  font-size: 0.76rem;
  font-weight: 880;
}

.ranking-row strong,
.ranking-row small,
.ranking-row p,
.ranking-row em {
  min-width: 0;
}

.ranking-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 780;
}

.ranking-row p,
.ranking-row em {
  grid-column: 2 / -1;
  margin: 0;
  color: var(--body);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 760;
  line-height: 1.35;
}

.ranking-row em {
  color: var(--warn);
}

.memory-ledger,
.preference-ledger {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 14px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.memory-row {
  display: grid;
  gap: 5px;
  min-height: 104px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.memory-row:not(:disabled):hover {
  border-color: var(--accent);
}

.memory-row:disabled {
  cursor: default;
}

.memory-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 860;
  text-transform: uppercase;
}

.memory-row strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.memory-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.35;
}

.next-action-row {
  display: grid;
  gap: 4px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 11px;
  text-align: left;
}

.next-action-row:not(:disabled):hover {
  border-color: var(--accent);
}

.next-action-row:disabled {
  cursor: default;
}

.next-action-row strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.next-action-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.35;
}

.report-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.report-listing {
  display: grid;
  gap: 5px;
  padding: 13px;
  color: var(--ink);
  text-align: left;
}

.report-listing span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.handoff-packet {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.handoff-packet span {
  color: var(--body);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.35;
}

.handoff-packet textarea {
  min-height: 260px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--body);
  padding: 12px;
  font: 0.8rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.switch-row.compact {
  min-height: 34px;
  margin-top: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 6px 10px;
  white-space: nowrap;
}

.comparison-list-manager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 12px;
}

.comparison-list-tabs {
  display: flex;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.comparison-list-tabs::-webkit-scrollbar {
  display: none;
}

.comparison-list-tabs button,
.comparison-save-form button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--body);
  font-size: 0.8rem;
  font-weight: 820;
  white-space: nowrap;
}

.comparison-list-tabs button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.comparison-list-tabs span {
  margin-left: 7px;
  border-radius: 999px;
  background: rgba(34, 79, 57, 0.1);
  padding: 2px 6px;
  font-size: 0.68rem;
}

.comparison-list-tabs button.active span {
  background: rgba(255, 255, 255, 0.18);
}

.comparison-save-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.comparison-save-form input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 11px;
  color: var(--body);
  font-size: 0.82rem;
  font-weight: 760;
}

.comparison-save-form button {
  background: var(--surface-strong);
  color: var(--ink);
}

.comparable-explainer {
  display: grid;
  gap: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.comparable-explainer-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.comparable-explainer-heading p,
.comparable-explainer-heading h3 {
  margin: 0;
}

.comparable-explainer-heading p {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.comparable-explainer-heading h3 {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.2;
}

.comparable-reason-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.comparable-reason-card {
  display: grid;
  gap: 5px;
  min-height: 76px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 11px;
  color: var(--body);
  text-align: left;
}

.comparable-reason-card strong {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.2;
}

.comparable-reason-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  line-height: 1.35;
}

.comparison-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.comparison-mini-card {
  display: grid;
  gap: 4px;
  min-height: 78px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.comparison-mini-card strong {
  font-size: 0.9rem;
  line-height: 1.2;
}

.comparison-mini-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
}

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

.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid var(--hairline-soft);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.comparison-table thead th {
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.78rem;
}

.comparison-table tbody th {
  width: 165px;
  color: var(--ink);
  font-weight: 850;
}

.comparison-table tbody th span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.comparison-table tbody tr.same td,
.comparison-table tbody tr.same th {
  color: var(--muted);
}

.comparison-table tr:last-child th,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.compare-listing-head {
  display: grid;
  gap: 3px;
  width: 100%;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.compare-listing-head strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.compare-listing-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.empty-comparison {
  border: 1px dashed var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.empty-workspace,
.empty-detail .empty-comparison {
  display: grid;
  gap: 10px;
}

.empty-workspace strong,
.empty-detail .empty-comparison strong {
  color: var(--ink);
  font-size: 1rem;
}

.empty-workspace p,
.empty-detail .empty-comparison p {
  margin: 0;
  line-height: 1.45;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-workspace .auth-button,
.empty-detail .auth-button,
.empty-actions {
  justify-self: start;
}

.property-card {
  display: grid;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  text-align: left;
}

.property-card:hover,
.property-card.selected {
  transform: translateY(-1px);
}

.property-card.selected .card-photo {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-photo,
.detail-photo {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--surface-strong);
  background-position: center;
  background-size: cover;
}

.card-photo {
  aspect-ratio: 1.18 / 1;
}

.card-photo span {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 6px;
  background: rgba(251, 252, 250, 0.94);
  padding: 6px 10px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 850;
}

.card-photo .photo-count {
  right: 10px;
  left: auto;
}

.card-copy {
  display: grid;
  gap: 3px;
}

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

.card-title span {
  font-weight: 800;
}

.card-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.card-copy .school-chip,
.card-copy .place-chip,
.card-copy .market-chip {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}

.card-copy .source-link {
  color: var(--accent-active);
  font-size: 0.78rem;
  font-weight: 850;
}

.card-copy .place-chip {
  color: var(--body);
}

.card-copy .market-chip {
  color: var(--accent-active);
}

.card-copy .market-chip.source-linked {
  color: var(--signal);
}

.map-panel {
  display: grid;
  gap: 10px;
}

.detail-content > .map-panel {
  margin-top: 18px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 14px;
}

.listing-map-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.listing-map-heading div {
  display: grid;
  gap: 2px;
}

.listing-map-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.listing-map-heading span,
.map-fallback-note {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1.35;
}

.route-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.listing-map-heading .route-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--surface-strong);
  padding: 7px 9px;
  color: var(--accent-active);
  font-size: 0.74rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.listing-map-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.heading-route-tabs {
  max-width: min(100%, 330px);
  justify-content: flex-end;
  padding-bottom: 0;
}

.listing-map-tabs button {
  display: grid;
  min-width: 86px;
  gap: 2px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--surface-strong);
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
}

.listing-map-tabs button.active {
  border-color: var(--accent-active);
  background: var(--accent-soft);
}

.heading-route-tabs button {
  min-width: 74px;
  padding: 6px 8px;
}

.listing-map-tabs span {
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-map-tabs small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.map-surface {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 127, 115, 0.1), transparent 38%),
    linear-gradient(135deg, #dfe8e3, #eef0df);
}

.google-map-wrap {
  position: relative;
  height: 260px;
  min-height: 260px;
  overflow: hidden;
  border-radius: 8px;
}

.google-map {
  width: 100%;
  height: 100%;
  min-height: 260px;
  background: var(--surface-strong);
}

.google-map-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.google-map-marker.listing {
  background: var(--surface);
  padding: 8px 10px;
}

.google-map-marker.listing.active {
  background: var(--accent-active);
  color: #ffffff;
}

.google-map-marker.place {
  min-width: 28px;
  min-height: 28px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
}

.google-map-marker.place.home {
  background: var(--signal);
  color: var(--ink);
}

.google-map-marker.place.parents {
  background: var(--accent);
}

.google-map-marker.place.work {
  background: var(--ink);
}

.map-line {
  position: absolute;
  width: 130%;
  height: 1px;
  background: rgba(34, 34, 34, 0.12);
  transform: rotate(-25deg);
}

.map-line.one {
  top: 42%;
  left: -15%;
}

.map-line.two {
  top: 66%;
  left: -18%;
  transform: rotate(18deg);
}

.map-route-line {
  position: absolute;
  z-index: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(8, 127, 115, 0.78);
  box-shadow: 0 0 0 3px rgba(8, 127, 115, 0.08);
  transform-origin: left center;
}

.map-marker {
  position: absolute;
  z-index: 2;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  transform: translate(-50%, -50%);
}

.map-marker.active {
  background: var(--accent-active);
  color: #ffffff;
}

.place-marker {
  position: absolute;
  z-index: 3;
  border: 2px solid var(--surface);
  border-radius: 6px;
  background: var(--ink);
  box-shadow: var(--shadow);
  padding: 6px 9px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.place-marker.active {
  border-color: var(--accent-active);
  box-shadow: 0 0 0 4px rgba(8, 127, 115, 0.14), var(--shadow);
}

.place-marker.home {
  background: var(--signal);
  color: var(--ink);
}

.place-marker.parents {
  background: var(--accent);
}

.place-marker.work {
  background: var(--ink);
}

.detail-panel {
  overflow: hidden;
}

.detail-photo {
  height: 190px;
  border-radius: 0;
}

.detail-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(78px, 1fr);
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--surface-strong);
  padding: 6px;
  scrollbar-width: thin;
}

.detail-gallery a {
  display: block;
  aspect-ratio: 1.2 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-muted);
}

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

.detail-header h2 {
  margin-top: 4px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.status.interested,
.status.contacted,
.status.viewing,
.status.offered {
  background: var(--accent-soft);
  color: var(--good);
}

.status.rejected {
  background: var(--danger-soft);
  color: var(--danger);
}

.status.hidden {
  background: var(--surface-muted);
  color: var(--muted);
}

.listing-source {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.listing-source a {
  color: var(--accent-active);
  text-decoration: none;
}

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

.decision-summary {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.decision-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.decision-summary-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.decision-summary-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.decision-summary-card strong {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.2;
}

.decision-summary-card small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 740;
  line-height: 1.25;
}

.decision-summary-card.good {
  border-left: 3px solid var(--good);
}

.decision-summary-card.warn {
  border-left: 3px solid var(--danger);
}

.decision-summary-card.muted,
.decision-summary-card.neutral {
  border-left: 3px solid var(--hairline);
}

.stat {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
}

.stat span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.stat strong {
  font-size: 0.96rem;
}

.mortgage-panel {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
}

.mortgage-table {
  display: grid;
  gap: 7px;
}

.mortgage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.mortgage-row strong,
.mortgage-row span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.mortgage-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.workflow-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 14px;
}

.workflow-status-grid,
.workflow-grid,
.follow-up-form,
.viewing-form,
.label-editor,
.listing-freshness-panel,
.agent-outreach-panel,
.offer-prep-panel,
.offer-follow-through-panel {
  display: grid;
  gap: 8px;
}

.workflow-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workflow-status-grid button,
.offer-form button {
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 820;
}

.workflow-status-grid button.active {
  border-color: var(--accent-active);
  background: var(--accent-active);
  color: #ffffff;
}

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

.offer-form {
  display: grid;
  grid-template-columns: 0.8fr 0.78fr minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.follow-up-form {
  grid-template-columns: 0.82fr minmax(0, 1fr) auto auto;
  align-items: end;
}

.label-editor {
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.listing-freshness-panel,
.offer-prep-panel,
.offer-follow-through-panel {
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.listing-freshness-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.listing-freshness-actions button {
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 820;
}

.listing-freshness-actions button:first-child {
  background: var(--accent-active);
  color: #ffffff;
}

.offer-prep-panel.ready,
.offer-follow-through-panel.ready {
  border-color: rgba(37, 116, 90, 0.34);
}

.offer-prep-panel.review,
.offer-follow-through-panel.review {
  border-color: rgba(173, 111, 25, 0.34);
}

.offer-prep-panel.blocked,
.offer-follow-through-panel.blocked {
  border-color: rgba(164, 61, 61, 0.34);
}

.offer-prep-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.83rem;
}

.offer-prep-summary strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.offer-prep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.offer-prep-actions button {
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 820;
}

.offer-prep-actions button:first-child {
  background: var(--accent-active);
  color: #ffffff;
}

.offer-prep-preview {
  min-height: 168px;
  resize: vertical;
}

.otp-readiness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.otp-readiness-grid button,
.offer-follow-through-actions button {
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 9px;
  font-size: 0.76rem;
  font-weight: 820;
}

.otp-readiness-grid button.active,
.offer-follow-through-actions button:first-child {
  border-color: var(--accent-active);
  background: var(--accent-active);
  color: #ffffff;
}

.offer-follow-through-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.offer-follow-through-actions button:disabled {
  cursor: default;
  opacity: 0.55;
}

.offer-follow-through-preview {
  min-height: 190px;
  resize: vertical;
}

.label-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.label-chip {
  min-height: 28px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 8px;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 850;
}

.label-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.label-input-row button {
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  color: var(--accent-active);
  font-size: 0.8rem;
  font-weight: 850;
}

.label-input-row button:disabled {
  cursor: default;
  opacity: 0.5;
}

.viewing-form,
.agent-outreach-panel {
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.outreach-actions,
.outreach-followups,
.reply-template-row,
.agent-reply-form,
.viewing-brief-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.outreach-actions button,
.outreach-followups button,
.reply-template-row button,
.agent-reply-form button,
.viewing-brief-actions button {
  min-height: 34px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 10px;
  color: var(--accent-active);
  font-size: 0.78rem;
  font-weight: 850;
}

.agent-reply-form {
  align-items: end;
}

.agent-reply-form .input-field {
  flex: 1 1 260px;
}

.agent-reply-form textarea {
  min-height: 78px;
}

.agent-reply-form button:disabled {
  cursor: default;
  opacity: 0.5;
}

.reply-template-row button {
  min-height: 32px;
  color: var(--body);
  font-size: 0.74rem;
}

.reply-template-row button.active {
  border-color: var(--accent-active);
  background: var(--accent-soft);
  color: var(--accent-active);
}

.agent-outreach-panel textarea {
  min-height: 220px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--body);
  padding: 10px;
  font: 0.78rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.viewing-brief-preview {
  min-height: 180px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--body);
  padding: 10px;
  font: 0.78rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.due-diligence-panel,
.renovation-items {
  display: grid;
  gap: 8px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.concern-toggle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.concern-toggle-grid button,
.question-list button {
  min-height: 32px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--body);
  padding: 7px 8px;
  font-size: 0.72rem;
  font-weight: 830;
}

.concern-toggle-grid button.active {
  border-color: var(--accent-active);
  background: var(--accent-soft);
  color: var(--accent-active);
}

.question-list {
  display: grid;
  gap: 6px;
}

.question-list button {
  text-align: left;
}

.renovation-item-list {
  display: grid;
  gap: 7px;
}

.renovation-item-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px;
}

.renovation-item-row strong,
.renovation-item-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.renovation-item-row span,
.renovation-item-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.renovation-item-row button {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 850;
}

.renovation-item-form {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) 0.7fr minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.renovation-item-form button {
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--accent-active);
  color: #ffffff;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 850;
}

.renovation-item-form button:disabled {
  cursor: default;
  opacity: 0.55;
}

.viewing-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.offer-form button {
  background: var(--accent);
  color: #ffffff;
}

.follow-up-form button,
.viewing-footer button {
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--accent-active);
  color: #ffffff;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 820;
}

.follow-up-form button.ghost {
  background: var(--surface);
  color: var(--accent-active);
}

.offer-form button:disabled {
  cursor: default;
  opacity: 0.55;
}

.offer-list {
  display: grid;
  gap: 7px;
}

.offer-row {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: 3px 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
}

.offer-row strong,
.offer-row span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.offer-row small,
.workflow-empty {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  line-height: 1.35;
}

.offer-row small {
  grid-column: 1 / -1;
}

.offer-actions {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 6px;
  margin-top: 3px;
}

.offer-actions button {
  min-height: 28px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface);
  padding: 5px 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.offer-actions button.active {
  border-color: var(--accent-active);
  background: var(--accent-soft);
  color: var(--accent-active);
}

.workflow-empty {
  margin: 0;
}

.activity-timeline {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 12px;
}

.activity-list {
  display: grid;
  gap: 7px;
}

.activity-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 9px 10px;
}

.activity-row span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
}

.activity-row strong {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 850;
}

.activity-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.35;
}

.activity-row.follow_up {
  outline: 1px solid rgba(8, 127, 115, 0.18);
}

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

.decision-copy h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.decision-copy p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.36;
}

.case-file-panel {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.case-file-panel p,
.case-file-panel small {
  margin: 0;
  color: var(--body);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-line;
}

.case-file-list {
  display: grid;
  gap: 6px;
}

.case-file-list span {
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 7px 8px;
  color: var(--body);
  font-size: 0.76rem;
  font-weight: 780;
  line-height: 1.35;
}

.school-panel,
.place-distance-panel {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 14px;
}

.school-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.school-heading h3 {
  margin: 0;
  font-size: 0.92rem;
}

.school-heading span,
.school-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.school-radius-groups {
  display: grid;
  gap: 6px;
}

.school-radius-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 8px;
  font-size: 0.78rem;
}

.school-radius-row > span {
  color: var(--muted);
  font-weight: 900;
  line-height: 1.5;
}

.school-radius-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.school-radius-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  border-radius: 6px;
  background: rgba(251, 252, 250, 0.62);
  padding: 3px 6px;
  color: var(--body);
  font-weight: 800;
  line-height: 1.25;
}

.school-radius-chip strong {
  min-width: 0;
  font-size: 0.76rem;
}

.school-radius-chip small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  white-space: nowrap;
}

.school-radius-chip.target {
  outline: 1px solid rgba(8, 127, 115, 0.34);
  background: var(--accent-soft);
}

.school-radius-chip.target::after {
  content: "target";
  color: var(--accent-active);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.school-radius-row.within_1km {
  background: var(--accent-soft);
}

.school-radius-row.between_1_2km {
  background: var(--signal-soft);
}

.place-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px 11px;
  color: var(--body);
  font-size: 0.82rem;
}

.route-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) auto;
  border: 1px solid transparent;
  cursor: pointer;
}

.route-row.active {
  border-color: var(--accent-active);
  background: var(--accent-soft);
}

.route-row:focus-visible {
  outline: 2px solid var(--accent-active);
  outline-offset: 2px;
}

.route-copy {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 0;
}

.route-copy span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: right;
}

.route-copy small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-align: right;
}

.route-row.live .route-copy small {
  color: var(--good);
}

.route-row.loading .route-copy small {
  color: var(--accent-active);
}

.route-row.fallback .route-copy small,
.route-row.estimated .route-copy small {
  color: var(--muted);
}

.route-row .route-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 6px;
  background: var(--surface);
  padding: 5px 8px;
  color: var(--accent-active);
  font-size: 0.74rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.place-distance-panel {
  border-top: 1px solid var(--hairline-soft);
  margin-top: 14px;
  padding-top: 14px;
}

.place-row.home {
  background: var(--signal-soft);
}

.place-row.parents {
  background: var(--accent-soft);
}

.place-row.work {
  background: var(--surface);
}

.market-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 14px;
}

.market-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.market-source {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.market-source strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.market-source a {
  color: var(--accent-active);
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.market-updated {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.market-signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.market-signal {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 9px 10px;
}

.market-signal.good {
  background: var(--signal-soft);
}

.market-signal.warn {
  background: var(--signal-soft);
}

.market-signal span,
.market-signal small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
}

.market-signal strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.15;
}

.market-signal.good strong {
  color: var(--good);
}

.market-signal.warn strong {
  color: var(--warn);
}

.market-records {
  display: grid;
  gap: 8px;
}

.market-record {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px 11px;
}

.market-record span,
.market-record small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.market-record strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.market-record p {
  color: var(--body);
}

.action-row,
.reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.action-row button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.action-row button.danger {
  color: var(--danger);
}

.reason-row {
  margin-top: 8px;
}

.reason-row button {
  min-height: 34px;
  color: var(--muted);
  font-size: 0.78rem;
}


@media (min-width: 1121px) {
  .left-rail,
  .right-rail {
    position: sticky;
    top: 94px;
    height: calc(100vh - 112px);
    max-height: calc(100vh - 112px);
  }

  .left-rail {
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .right-rail {
    overflow: visible;
  }

  .right-rail .detail-panel {
    max-height: 100%;
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 1440px) {
  .top-nav .brand-copy {
    display: none;
  }
}

@media (max-width: 1280px) {
  .top-nav {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .top-metrics {
    display: none;
  }

  .workspace {
    grid-template-columns: 300px minmax(340px, 1fr) 360px;
    gap: 14px;
    padding-inline: 18px;
  }

  .right-rail {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 320px minmax(360px, 1fr);
  }

  .right-rail {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .workspace,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .onboarding-shell {
    align-items: start;
  }

  .onboarding-card-grid,
  .workspace-choice-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-card.wide {
    grid-row: auto;
  }

  .top-nav {
    grid-template-columns: 1fr;
  }

  .left-rail {
    grid-template-rows: auto auto;
  }

  .left-rail.has-profile {
    grid-template-rows: auto auto auto;
  }

  .primary-chat {
    min-height: 480px;
  }

  .empty-chat-workspace {
    place-items: start center;
    padding: 24px 16px;
  }

  .empty-chat-heading {
    text-align: left;
  }

  .empty-chat-heading span {
    justify-self: start;
  }

  .empty-chat-heading h1 {
    font-size: 1.55rem;
  }

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

  .empty-chat-panel {
    min-height: 520px;
  }

  .empty-chat-prompts {
    justify-content: flex-start;
  }

  .search-pill,
  .top-chat-form {
    grid-template-columns: 1fr;
    border-radius: 8px;
    padding: 8px;
  }

  .top-chat-form span {
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
    padding: 4px 2px 8px;
  }

  .top-chat-form button {
    width: 100%;
  }

  .search-pill label {
    border-right: 0;
    border-bottom: 1px solid var(--hairline-soft);
    padding: 10px 12px;
  }

  .search-pill button {
    width: 100%;
    margin: 8px 0 0;
  }

  .top-metrics {
    justify-content: flex-start;
  }

  .top-left-actions,
  .top-workspace-controls,
  .top-right-actions {
    grid-column: 1;
    justify-self: start;
  }

  .top-workspace-controls {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    justify-content: stretch;
  }

  .top-workspace-controls .workspace-switcher,
  .top-workspace-controls .workspace-filter-panel {
    grid-column: 1;
    justify-self: start;
  }

  .account-actions {
    justify-content: flex-start;
  }

  .auth-form {
    width: 100%;
  }

  .auth-form input {
    flex: 1;
    min-width: 0;
  }

  .section-title {
    display: grid;
  }

  .section-tools {
    justify-items: start;
  }

  .filter-stack {
    justify-items: start;
  }

  .workspace-switcher {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .workspace-switcher button {
    flex: 0 0 auto;
    min-width: 82px;
    padding-inline: 9px;
  }

  .filter-row {
    justify-content: flex-start;
  }

  .comparison-toolbar {
    display: grid;
  }

  .comparison-list-manager {
    grid-template-columns: 1fr;
  }

  .comparison-actions {
    justify-content: flex-start;
  }

  .candidate-review-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .pipeline-board {
    grid-template-columns: repeat(5, minmax(240px, 78vw));
  }
}

@media (max-width: 560px) {
  .top-nav,
  .workspace,
  .onboarding-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .top-nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand app account"
      "workspace workspace workspace";
    align-items: center;
    gap: 8px 10px;
  }

  .top-metrics {
    gap: 6px;
  }

  .top-left-actions {
    display: contents;
  }

  .top-workspace-controls {
    grid-area: workspace;
    grid-column: 1 / -1;
    display: grid;
    width: 100%;
    gap: 8px;
    justify-content: stretch;
    justify-self: stretch;
  }

  .top-right-actions {
    grid-area: account;
    grid-column: auto;
    justify-self: end;
  }

  .brand-lockup {
    grid-area: brand;
  }

  .wordmark {
    width: 40px;
    height: 40px;
  }

  .app-switcher {
    grid-area: app;
    width: auto;
    max-width: 100%;
    justify-self: center;
  }

  .app-switcher button {
    flex: 0 0 auto;
    min-width: 70px;
    padding: 0 10px;
  }

  .account-actions {
    justify-content: flex-end;
  }

  .top-metrics span,
  .account-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .profile-grid,
  .onboarding-field-grid,
  .district-controls,
  .place-fields,
  .workflow-grid,
  .workflow-status-grid,
  .offer-form,
  .follow-up-form,
  .viewing-footer,
  .offer-prep-summary,
  .otp-readiness-grid,
  .label-input-row,
  .concern-toggle-grid,
  .renovation-item-row,
  .renovation-item-form,
  .pipeline-action-strip,
  .saved-search-row,
  .decision-copy,
  .decision-summary-grid,
  .school-radius-row,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .route-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .listing-map-heading {
    display: grid;
  }

  .heading-route-tabs {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
  }

  .route-copy,
  .route-copy span,
  .route-copy small {
    justify-items: start;
    text-align: left;
  }

  .route-actions {
    justify-content: flex-start;
  }

  .map-label small {
    max-width: 240px;
  }

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

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

  .candidate-review-grid,
  .candidate-review-copy div,
  .candidate-review-actions {
    grid-template-columns: 1fr;
  }

  .comparison-toolbar,
  .empty-comparison,
  .onboarding-panel,
  .listing-import-dialog {
    padding: 14px;
  }

  .segment.three {
    grid-template-columns: 1fr;
  }

  .dialog-heading,
  .dialog-actions {
    display: grid;
  }
}

/* ─── Pane fallback placeholders ───────────────────────────────────────── */

:root {
  --cockpit-placeholder-fg: #8a8a85;
}

.cockpit-pane {
  background: #ffffff;
  overflow: auto;
  position: relative;
}

.cockpit-pane-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--cockpit-placeholder-fg);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}
