:root {
  color-scheme: light;
  --ink: #1f2330;
  --muted: #626a7d;
  --line: #d9dce8;
  --paper: #ffffff;
  --soft: #f4f6f1;
  --mint: #dbeadd;
  --lavender: #e4e0ff;
  --violet: #844df5;
  --violet-dark: #6234c9;
  --teal: #157f82;
  --green: #28794d;
  --amber: #a86300;
  --rose: #b6425d;
  --shadow: 0 18px 44px rgba(37, 38, 51, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(219, 234, 221, 0.95) 0%, rgba(248, 247, 242, 0.95) 34%, rgba(228, 224, 255, 0.9) 100%),
    var(--soft);
  letter-spacing: 0;
}

body.landing-page {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 92% 5%, rgba(91, 132, 255, 0.44) 0, transparent 34%),
    linear-gradient(147deg, #e4f0df 0%, #f6f4f2 43%, #d9defd 100%);
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.landing-shell {
  width: min(100% - 72px, 1626px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0 52px;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 23px;
  border-bottom: 2px solid rgba(132, 77, 245, 0.64);
}

.landing-brand,
.landing-top-button,
.landing-cta {
  text-decoration: none;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #844df5;
  font-size: 1.55rem;
  font-weight: 850;
}

.landing-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #844df5, #5b84ff);
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(132, 77, 245, 0.22);
}

.landing-top-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 254px;
  min-height: 62px;
  border-radius: 999px;
  color: #844df5;
  background: rgba(235, 232, 255, 0.72);
  font-size: 1.35rem;
  font-weight: 650;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(500px, 0.95fr) minmax(580px, 1.05fr);
  gap: 36px;
  align-items: start;
  min-height: calc(100vh - 186px);
  padding-top: 48px;
}

.landing-copy {
  padding-top: 34px;
  min-width: 0;
}

.landing-copy h1 {
  max-width: 760px;
  color: #844df5;
  font-size: clamp(4.4rem, 5.2vw, 5.8rem);
  font-weight: 760;
  line-height: 1.08;
}

.landing-copy p {
  max-width: 704px;
  margin: 22px 0 26px;
  color: #844df5;
  font-size: clamp(1.25rem, 1.62vw, 1.8rem);
  line-height: 1.42;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 286px;
  min-height: 73px;
  border-radius: 999px;
  color: #fff;
  background: #844df5;
  box-shadow: 0 16px 32px rgba(132, 77, 245, 0.25);
  font-size: 1.34rem;
  font-weight: 700;
}

.landing-visual {
  position: relative;
  min-height: 710px;
}

.landing-visual img {
  display: block;
  width: min(100%, 750px);
  min-height: 520px;
  margin-left: auto;
  border-radius: 54px;
  object-fit: cover;
  box-shadow: none;
}

.landing-analyze-card {
  position: absolute;
  right: -2px;
  bottom: 18px;
  width: min(510px, 68%);
  min-height: 236px;
  padding: 38px 44px;
  border-radius: 42px;
  color: #844df5;
  background: rgba(225, 226, 255, 0.88);
}

.landing-analyze-card p {
  margin: 0 0 18px;
  font-size: clamp(1.35rem, 1.85vw, 2rem);
  line-height: 1.15;
}

.landing-analyze-card ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1.06rem, 1.5vw, 1.55rem);
  font-weight: 850;
}

.landing-analyze-card li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.landing-analyze-card li::before {
  content: "✓";
  flex: 0 0 auto;
  font-size: 1.25em;
  line-height: 0.88;
}

.file-import {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px 22px;
  border-right: 1px solid rgba(132, 77, 245, 0.2);
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(18px);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--violet);
  font-weight: 800;
  font-size: 1.38rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #5b84ff);
  box-shadow: 0 10px 24px rgba(132, 77, 245, 0.24);
}

.brand-sub {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.search-box {
  margin: 18px 0 14px;
}

.search-box input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 86px;
}

.search-box input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(132, 77, 245, 0.14);
}

.filter-row,
.button-row,
.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-row {
  margin-bottom: 16px;
}

.btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: none;
  white-space: nowrap;
}

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

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

.btn.secondary {
  color: var(--violet-dark);
  background: rgba(132, 77, 245, 0.12);
  border-color: rgba(132, 77, 245, 0.14);
}

.btn.ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.btn.danger {
  color: #fff;
  background: var(--rose);
}

.btn.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.86rem;
}

.btn[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
}

.property-list {
  display: grid;
  gap: 10px;
  padding-bottom: 28px;
}

.property-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(217, 220, 232, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 13px;
  color: var(--ink);
}

.property-card:hover,
.property-card.is-active {
  border-color: rgba(132, 77, 245, 0.42);
  box-shadow: 0 12px 28px rgba(63, 63, 88, 0.08);
}

.property-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.property-meta {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 25px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--violet-dark);
  background: rgba(132, 77, 245, 0.14);
}

.status-pill.own {
  color: var(--green);
  background: rgba(40, 121, 77, 0.13);
}

.status-pill.looking {
  color: var(--teal);
  background: rgba(21, 127, 130, 0.13);
}

.status-pill.selling {
  color: var(--amber);
  background: rgba(168, 99, 0, 0.14);
}

.value-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 850;
  color: var(--muted);
  background: rgba(98, 106, 125, 0.12);
}

.value-pill.current {
  color: var(--green);
  background: rgba(40, 121, 77, 0.13);
}

.value-pill.due {
  color: var(--amber);
  background: rgba(168, 99, 0, 0.14);
}

.value-pill.missing {
  color: var(--rose);
  background: rgba(182, 66, 93, 0.12);
}

.main {
  min-width: 0;
  padding: 30px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(440px, 1.15fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(132, 77, 245, 0.22);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--violet);
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 720px;
  color: var(--violet);
  font-size: 3.2rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

.topbar-copy {
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.scenario-controls {
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: 0;
}

.scenario-controls select {
  width: min(100%, 390px);
  min-width: 0;
  border: 1px solid rgba(132, 77, 245, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 10px 11px;
}

.scenario-controls .button-row,
.scenario-controls .export-row {
  justify-content: flex-end;
}

.scenario-controls .export-row {
  max-width: 860px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.metric-card,
.panel {
  border: 1px solid rgba(217, 220, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 104px;
  padding: 14px;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-value {
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 850;
  line-height: 1.1;
}

.metric-foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.stacked-grid {
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

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

.panel-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.chart-wrap {
  min-height: 260px;
}

.chart-bars {
  display: grid;
  gap: 10px;
  min-height: 260px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--violet);
}

.legend-swatch.noi {
  background: var(--teal);
}

.legend-swatch.cash {
  background: var(--violet);
}

.legend-swatch.negative {
  background: var(--rose);
}

.bar-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  min-height: 214px;
  padding: 12px 10px;
  border: 1px solid rgba(217, 220, 232, 0.74);
  border-radius: 8px;
  background: rgba(244, 246, 241, 0.48);
}

.bar-grid.annual-bars {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bar-item {
  display: grid;
  grid-template-rows: 150px auto auto;
  min-width: 0;
  align-items: end;
  gap: 6px;
}

.bar-stack {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 4px;
  height: 150px;
  border-bottom: 1px solid rgba(98, 106, 125, 0.28);
}

.bar {
  width: min(100%, 24px);
  min-height: 4px;
  height: var(--bar-height);
  border-radius: 5px 5px 0 0;
  background: var(--violet);
}

.bar.noi {
  background: var(--teal);
}

.bar.cash {
  background: var(--violet);
}

.bar.negative {
  background: var(--rose);
}

.bar-label,
.bar-value {
  overflow: hidden;
  color: var(--muted);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label {
  font-size: 0.75rem;
  font-weight: 750;
}

.bar-value {
  font-size: 0.72rem;
}

canvas {
  display: block;
  width: 100%;
  height: 260px;
}

.recommendations {
  display: grid;
  gap: 10px;
}

.rec-item {
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: rgba(21, 127, 130, 0.08);
  padding: 10px 11px;
}

.rec-item.warn {
  border-left-color: var(--amber);
  background: rgba(168, 99, 0, 0.1);
}

.rec-item.bad {
  border-left-color: var(--rose);
  background: rgba(182, 66, 93, 0.1);
}

.rec-title {
  font-weight: 850;
}

.rec-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.valuation-banner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(98, 106, 125, 0.18);
  border-radius: 8px;
  background: rgba(244, 246, 241, 0.68);
}

.valuation-banner.current {
  border-color: rgba(40, 121, 77, 0.22);
  background: rgba(40, 121, 77, 0.08);
}

.valuation-banner.due {
  border-color: rgba(168, 99, 0, 0.24);
  background: rgba(168, 99, 0, 0.08);
}

.valuation-banner.missing {
  border-color: rgba(182, 66, 93, 0.2);
  background: rgba(182, 66, 93, 0.08);
}

.valuation-title {
  font-weight: 850;
}

.valuation-copy {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.valuation-history {
  margin-top: 12px;
}

.valuation-empty {
  margin-top: 12px;
}

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

.wide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

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

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

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

.field {
  min-width: 0;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(98, 106, 125, 0.46);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  outline: none;
}

.info-tip:focus-visible {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(132, 77, 245, 0.14);
}

.info-tip-text {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(270px, 74vw);
  padding: 9px 10px;
  border: 1px solid rgba(31, 35, 48, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.38;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

.info-tip:hover .info-tip-text,
.info-tip:focus .info-tip-text {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fieldset {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.unit-card {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 246, 241, 0.58);
}

.unit-list {
  display: grid;
  gap: 10px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
  font-weight: 750;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.forecast-monthly {
  margin-bottom: 14px;
}

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

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid rgba(217, 220, 232, 0.74);
  text-align: right;
  vertical-align: top;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

thead th {
  color: var(--muted);
  background: rgba(244, 246, 241, 0.82);
  font-weight: 850;
}

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

.positive {
  color: var(--green);
  font-weight: 800;
}

.negative {
  color: var(--rose);
  font-weight: 800;
}

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

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
}

.blank-dashboard {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.blank-dashboard h2 {
  color: var(--ink);
}

.blank-dashboard p {
  max-width: 560px;
  margin: 0;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1220px) {
  .landing-shell {
    width: min(100% - 44px, 980px);
    padding-top: 34px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
    min-height: 0;
  }

  .landing-copy h1,
  .landing-copy p {
    max-width: 820px;
  }

  .landing-visual {
    min-height: 520px;
  }

  .landing-visual img {
    width: 100%;
    min-height: 420px;
  }

  .landing-analyze-card {
    right: 24px;
    bottom: 0;
  }

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

  .scenario-controls {
    justify-items: stretch;
  }

  .scenario-controls select {
    width: 100%;
    max-width: none;
  }

  .scenario-controls .button-row,
  .scenario-controls .export-row {
    justify-content: flex-start;
  }

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

  .dashboard-grid,
  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .landing-shell {
    width: min(100% - 28px, 680px);
    padding: 24px 0 32px;
  }

  .landing-header {
    align-items: stretch;
    gap: 14px;
  }

  .landing-brand {
    font-size: 1.32rem;
  }

  .landing-top-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 20px;
    font-size: 1rem;
  }

  .landing-hero {
    padding-top: 34px;
  }

  .landing-copy h1 {
    font-size: 3.55rem;
  }

  .landing-copy p {
    font-size: 1.2rem;
  }

  .landing-cta {
    min-width: 0;
    width: min(100%, 286px);
    min-height: 58px;
    font-size: 1.1rem;
  }

  .landing-visual {
    min-height: auto;
    padding-bottom: 170px;
  }

  .landing-visual img {
    min-height: 300px;
    border-radius: 34px;
  }

  .landing-analyze-card {
    right: 10px;
    bottom: 0;
    width: calc(100% - 20px);
    min-height: 0;
    padding: 24px 26px;
    border-radius: 28px;
  }

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

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(132, 77, 245, 0.2);
  }

  .main {
    padding: 22px 16px;
  }

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

  h1 {
    font-size: 2.45rem;
  }

  .summary-grid,
  .form-grid,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .unit-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .landing-header {
    flex-direction: column;
  }

  .landing-top-button {
    width: 100%;
  }

  .landing-copy h1 {
    font-size: 2.75rem;
  }

  .landing-analyze-card ul {
    font-size: 1rem;
  }
}
