:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-2: #eef4f0;
  --ink: #19211d;
  --muted: #637066;
  --line: #d9e2dc;
  --teal: #0d7c75;
  --teal-dark: #075b57;
  --coral: #c8563c;
  --gold: #b4872d;
  --blue: #27658f;
  --danger: #a83a31;
  --shadow: 0 18px 60px rgba(20, 38, 32, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.04rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 0.83rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.nav button,
.account-area button,
.tabs button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.nav button.active,
.nav button:hover,
.account-area button:hover,
.tabs button.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.account-area {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.language-switcher span {
  color: var(--muted);
}

#googleTranslateElement {
  min-width: 148px;
}

#googleTranslateElement.is-unavailable {
  min-width: 0;
  color: var(--danger);
  font-size: 0.78rem;
}

#googleTranslateElement .goog-te-gadget {
  color: transparent;
  font-size: 0;
  line-height: 1;
}

#googleTranslateElement .goog-te-gadget-simple {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

#googleTranslateElement .goog-te-gadget-simple img {
  display: none;
}

#googleTranslateElement .goog-te-menu-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
}

.credit-pill {
  border-radius: 999px;
  background: #e7f0ed;
  color: var(--teal-dark);
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 850;
}

body.is-locked .nav,
body.is-locked .account-area {
  display: none;
}

body.is-locked .topbar {
  justify-content: center;
}

body.is-locked main {
  display: grid;
  min-height: calc(100vh - 72px);
  place-items: start center;
}

body.is-locked #appView {
  width: 100%;
}

body.is-locked .shell {
  display: block;
  width: min(520px, 100%);
  padding-top: clamp(34px, 9vh, 88px);
}

body.is-locked .workspace,
body.is-locked #profilePanel,
body.is-locked #uploadPanel {
  display: none;
}

body.is-locked .sidebar {
  display: block;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 34px) 46px;
}

.sidebar,
.workspace {
  min-width: 0;
}

.panel,
.compare-panel,
.property-card,
.content-band,
.welcome-panel,
.demo-panel {
  min-width: 0;
}

.sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 96px;
  padding: 8px 0;
}

.workspace-head h1,
.content-band h1 {
  margin: 2px 0 0;
  font-size: clamp(2rem, 4vw, 4.1rem);
  line-height: 1.02;
}

.eyebrow {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.panel,
.compare-panel,
.property-card,
.price-box,
.welcome-panel,
.demo-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel,
.compare-panel,
.property-card,
.welcome-panel,
.demo-panel {
  padding: 18px;
}

.compare-panel:focus {
  outline: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.compare-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.compare-actions .status-pill {
  max-width: min(42vw, 380px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  padding: 0;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(13, 124, 117, 0.45);
  background: var(--surface-2);
  outline: 0;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h2,
h3 {
  margin: 0;
}

h2 {
  font-size: 1.04rem;
}

h3 {
  font-size: 1rem;
}

p {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--teal-dark);
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.warn {
  background: #fff4e0;
  color: #7b5308;
}

.status-pill.danger {
  background: #ffecea;
  color: var(--danger);
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 124, 117, 0.12);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary,
.secondary,
.danger-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.primary {
  background: var(--teal);
  color: #fff;
}

.primary:hover {
  background: var(--teal-dark);
}

.primary:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: wait;
  opacity: 0.68;
}

.ai-processing {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #b9ded9;
  border-radius: 8px;
  background: #e9f7f5;
  color: var(--teal-dark);
  padding: 11px 12px;
  font-size: 0.88rem;
  font-weight: 800;
}

.ai-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 3px solid rgba(13, 124, 117, 0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.78s linear infinite;
}

#uploadPanel.is-processing {
  border-color: #8ccbc4;
  box-shadow: 0 18px 60px rgba(13, 124, 117, 0.16);
}

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

.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.danger-button {
  border-color: #f2c3bc;
  background: #fff0ee;
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.verification-box {
  margin-top: 12px;
  border: 1px solid #d9bc70;
  border-radius: 8px;
  background: #fff8e8;
  padding: 12px;
  color: #604811;
  font-size: 0.9rem;
}

.verification-box a {
  color: var(--teal-dark);
  font-weight: 800;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
  min-width: min(420px, 100%);
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

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

.metric strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.28rem;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1940px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0;
  text-transform: uppercase;
}

td {
  font-size: 0.92rem;
}

.sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 12px 10px;
  text-align: left;
  text-transform: inherit;
  font-size: inherit;
  font-weight: 900;
}

.sort-button:hover,
.sort-button:focus-visible {
  background: #e4eee8;
  color: var(--teal-dark);
  outline: 0;
}

.sort-button.active {
  color: var(--teal-dark);
}

.sort-indicator {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 0.72rem;
  opacity: 0.62;
}

.score-triple {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.score-value {
  color: var(--muted);
  font-weight: 700;
}

.score-value.active {
  color: var(--teal-dark);
  font-size: 1.05em;
  font-weight: 950;
}

.score-separator {
  color: #9aa7a0;
  font-weight: 700;
}

.number-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.completion-cell {
  display: grid;
  gap: 3px;
  min-width: 112px;
}

.completion-cell strong {
  color: var(--teal-dark);
  font-size: 1rem;
}

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

.completion-cell small {
  color: var(--muted);
  line-height: 1.25;
}

.mobility-cell {
  display: grid;
  gap: 3px;
  min-width: 128px;
}

.mobility-cell strong {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.2;
}

.mobility-cell span {
  color: var(--teal-dark);
  font-weight: 850;
  white-space: nowrap;
}

.mobility-cell small {
  color: var(--muted);
  line-height: 1.25;
}

tr:last-child td {
  border-bottom: 0;
}

.comparison-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 28px);
}

.comparison-lightbox__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(20, 31, 27, 0.62);
  backdrop-filter: blur(3px);
}

.comparison-lightbox__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(96vw, 1680px);
  height: min(92vh, 980px);
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 100px rgba(5, 22, 18, 0.34);
  padding: clamp(14px, 2vw, 24px);
}

.comparison-lightbox__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.comparison-lightbox__head h2 {
  margin-top: 2px;
  font-size: clamp(1.35rem, 2vw, 2.2rem);
}

.comparison-lightbox__head .status-pill {
  max-width: min(52vw, 520px);
}

.table-wrap--fullscreen {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.table-wrap--fullscreen table {
  min-width: max(2240px, 100%);
}

.table-wrap--fullscreen th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.table-wrap--fullscreen th:first-child,
.table-wrap--fullscreen td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}

.table-wrap--fullscreen th:first-child {
  z-index: 3;
  background: var(--surface-2);
}

.property-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.property-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.property-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 56%, transparent 58%),
    conic-gradient(var(--teal) calc(var(--score, 0) * 1%), #dde7e1 0);
  color: var(--ink);
  font-weight: 900;
}

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

.fact {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-height: 64px;
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.fact strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.tag-list,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 800;
}

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

.welcome-panel {
  display: grid;
  gap: 18px;
}

.welcome-panel h2,
.demo-panel h2 {
  margin: 2px 0 0;
  font-size: clamp(1.35rem, 2.2vw, 2.2rem);
  line-height: 1.12;
}

.welcome-panel p,
.section-copy {
  max-width: 880px;
  color: var(--muted);
  line-height: 1.65;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.welcome-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-dark);
  padding: 0 14px;
  font-weight: 850;
}

.welcome-actions .primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

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

.feature-grid article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.feature-grid strong {
  color: var(--teal-dark);
}

.feature-grid span {
  color: var(--muted);
  line-height: 1.45;
}

.demo-panel {
  display: grid;
  gap: 14px;
}

.demo-panel .panel-head {
  align-items: flex-start;
  margin-bottom: 0;
}

.demo-panel .panel-head > div:first-child {
  min-width: 0;
}

.demo-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.demo-panel-body {
  display: grid;
  gap: 14px;
}

.demo-toggle {
  width: 34px;
  height: 34px;
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1;
}

.demo-toggle span {
  display: block;
  transform: translateY(-1px);
}

.demo-panel.is-collapsed {
  gap: 0;
}

.demo-panel.is-collapsed .status-pill {
  display: none;
}

.demo-panel.is-collapsed .panel-head {
  align-items: center;
}

.content-band {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 6vw, 70px) clamp(16px, 4vw, 40px);
}

.content-band.narrow {
  width: min(760px, 100%);
}

.steps,
.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.steps article,
.legal-grid article {
  border-top: 4px solid var(--teal);
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.steps strong {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7f0ed;
  color: var(--teal-dark);
}

.price-box {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding: 24px;
}

.pricing-grid .price-box {
  margin-top: 0;
}

.price-box.featured {
  border-color: rgba(13, 124, 117, 0.45);
  background: #f3faf7;
}

.price-box span {
  color: var(--muted);
  font-weight: 800;
}

.price-box strong {
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 1;
}

.price-box .primary {
  width: 100%;
  margin-top: 4px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(460px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.wizard-target {
  outline: 2px solid rgba(13, 124, 117, 0.55);
  outline-offset: 5px;
  box-shadow: 0 0 0 6px rgba(13, 124, 117, 0.07), var(--shadow);
}

.wizard-target-danger {
  outline-color: rgba(192, 52, 40, 0.72);
  box-shadow: 0 0 0 6px rgba(192, 52, 40, 0.1), var(--shadow);
}

.onboarding-bubble {
  position: fixed;
  z-index: 90;
  display: grid;
  gap: 7px;
  width: min(330px, calc(100vw - 24px));
  border: 1px solid rgba(13, 124, 117, 0.42);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(6, 35, 30, 0.18);
  padding: 14px 16px;
}

.onboarding-bubble.is-danger {
  border-color: rgba(192, 52, 40, 0.72);
  background: #fff8f7;
}

.onboarding-bubble::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-left: 1px solid rgba(13, 124, 117, 0.42);
  border-bottom: 1px solid rgba(13, 124, 117, 0.42);
  background: #fff;
  transform: rotate(45deg);
}

.onboarding-bubble.is-danger::after {
  border-color: rgba(192, 52, 40, 0.72);
  background: #fff8f7;
}

.onboarding-bubble.arrow-left::after {
  left: -8px;
  top: 26px;
}

.onboarding-bubble.arrow-right::after {
  right: -8px;
  top: 26px;
  transform: rotate(225deg);
}

.onboarding-bubble.arrow-top::after {
  left: 26px;
  top: -8px;
  transform: rotate(135deg);
}

.onboarding-bubble.arrow-bottom::after {
  left: 26px;
  bottom: -8px;
  transform: rotate(315deg);
}

.onboarding-bubble .eyebrow {
  font-size: 0.7rem;
}

.onboarding-bubble strong {
  color: var(--teal-dark);
  font-size: 1rem;
}

.onboarding-bubble.is-danger strong {
  color: #b3281f;
}

.onboarding-bubble span {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
  }

  .account-area {
    width: 100%;
  }

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

  .workspace-head {
    display: grid;
  }

  .feature-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    gap: 10px;
  }

  .brand {
    width: 100%;
    justify-content: flex-start;
  }

  .metric-strip,
  .field-row,
  .facts,
  .manual-grid {
    grid-template-columns: 1fr;
  }

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

  .shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .panel,
  .compare-panel,
  .property-card {
    padding: 14px;
  }

  .panel-head,
  .comparison-lightbox__head {
    align-items: flex-start;
  }

  .comparison-lightbox {
    padding: 8px;
  }

  .comparison-lightbox__panel {
    width: 100%;
    height: 94vh;
  }

  .comparison-lightbox__head {
    display: grid;
  }

  .compare-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .compare-actions .status-pill {
    max-width: calc(100% - 46px);
  }
}
