:root {
  --bg-page: #eff2f3;
  --bg-panel: #ffffff;
  --bg-subtle: #f5f7f7;
  --text-primary: #1f2a32;
  --text-muted: #5e6a71;
  --line: #d8dfdf;
  --brand: #1d4f5e;
  --brand-soft: #2f6878;
  --brand-accent: #5b7f34;
  --good: #2f7a64;
  --bad: #af4949;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-page);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.page-shell {
  width: min(1400px, calc(100% - 40px));
  margin: 28px auto 44px;
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid #e3e9e9;
  border-radius: var(--radius);
  padding: 22px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: center;
}

.hero-image {
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.hero-text {
  display: grid;
  gap: 14px;
}

.eyebrow {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
}

h1 {
  font-size: clamp(34px, 3.1vw, 56px);
  line-height: 1.06;
  max-width: 640px;
}

.hero-text p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 620px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cta-hint {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  border-left: 4px solid var(--brand);
  padding: 6px 0 6px 12px;
}

.cta-hint:hover {
  text-decoration: underline;
}

.btn {
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: #173f4b;
}

.btn-outline {
  background: #fff;
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: #bcc8c9;
  background: var(--bg-subtle);
}

.btn.full-width {
  width: 100%;
}

.copy-status {
  min-height: 18px;
  font-size: 14px;
  color: var(--brand-soft);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(450px, 1.06fr);
  gap: 20px;
  align-items: start;
}

.left-column,
.right-column {
  display: grid;
  gap: 18px;
}

.left-column h2,
.right-column h2 {
  font-size: 38px;
  line-height: 1.08;
}

.left-column h2 {
  font-size: 36px;
}

.apartment-list {
  display: grid;
  gap: 14px;
}

.apartment-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.apartment-card:hover {
  border-color: #9fb0b4;
  transform: translateY(-2px);
}

.apartment-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(29, 79, 94, 0.12);
}

.apartment-card img {
  width: 100%;
  height: 300px;
  object-fit: contain;
  background: #f0f3f3;
  padding: 8px;
}

.apartment-copy {
  padding: 12px 14px 14px;
  display: grid;
  gap: 6px;
}

.apartment-copy h3 {
  font-size: 26px;
}

.apartment-copy p,
.apartment-copy strong {
  font-size: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 16px;
  color: var(--text-primary);
}

input[type="range"] {
  padding: 0;
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid #7aa7b5;
  outline-offset: 2px;
}

.inline-inputs {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.slider-value {
  font-size: 24px;
  font-weight: 700;
  color: #2f5430;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
}

.chip input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.advanced-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-subtle);
}

.step-label {
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

.wealth-headline {
  font-size: clamp(42px, 4vw, 66px);
  color: var(--brand);
  font-weight: 800;
}

.wealth-delta {
  font-size: 15px;
  color: var(--text-muted);
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-stats article,
.stat-grid article {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.mini-stats span,
.stat-grid span {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mini-stats strong,
.stat-grid strong {
  font-size: 24px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-head h3 {
  font-size: 28px;
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.segment {
  border: 0;
  background: #fff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.segment.active {
  background: var(--brand);
  color: #fff;
}

canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.range-note {
  color: var(--text-muted);
  font-size: 14px;
}

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

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

.table-wrap {
  overflow: auto;
}

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

th,
td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: right;
  font-size: 13px;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #ecf1f2;
}

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

.facts-panel h2 {
  font-size: 42px;
}

.facts-panel > p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 1000px;
}

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

.fact-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.fact-card strong {
  font-size: 36px;
  color: var(--brand);
}

.fact-card span {
  font-size: 18px;
  font-weight: 700;
}

.fact-card small {
  color: var(--text-muted);
  font-size: 14px;
}

.bar-track {
  height: 8px;
  background: #e5ecec;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--brand);
}

.w-82 {
  width: 82%;
}

.w-68 {
  width: 68%;
}

.w-55 {
  width: 55%;
}

.w-36 {
  width: 36%;
}

.positive {
  color: var(--good);
}

.negative {
  color: var(--bad);
}

body.customer-mode .advisor-only {
  display: none;
}

@media (max-width: 1240px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: calc(100% - 20px);
  }

  .panel {
    padding: 16px;
  }

  .left-column h2,
  .right-column h2,
  .facts-panel h2 {
    font-size: 30px;
  }

  .inline-inputs,
  .mini-stats,
  .stat-grid,
  .facts-grid,
  .advanced-fields {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
