:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #5a6962;
  --line: #d9e2dd;
  --paper: #f7faf6;
  --panel: #ffffff;
  --teal: #177c72;
  --teal-dark: #0f5f58;
  --coral: #d7664b;
  --sand: #ead8b8;
  --leaf: #5c7f49;
  --shadow: 0 18px 50px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(135deg, rgba(23, 124, 114, 0.08), rgba(215, 102, 75, 0.05)),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: stretch;
  min-height: 260px;
}

.intro__copy {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: center;
  padding: 34px 0;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.intro__text {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.island-panel {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(23, 124, 114, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #d8f0ec 0%, #f7e7c7 58%, #8dc7c0 59%, #3e928d 100%);
  box-shadow: var(--shadow);
}

.sun {
  position: absolute;
  top: 34px;
  right: 46px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #f2af65;
}

.ridge {
  position: absolute;
  right: -20px;
  bottom: 80px;
  left: -40px;
  height: 140px;
  clip-path: polygon(0 64%, 22% 30%, 37% 52%, 52% 18%, 72% 48%, 100% 20%, 100% 100%, 0 100%);
}

.ridge--back {
  background: rgba(92, 127, 73, 0.55);
}

.ridge--front {
  bottom: 52px;
  background: #476b42;
  transform: translateY(28px);
}

.villa {
  position: absolute;
  right: 64px;
  bottom: 72px;
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 8px;
  align-items: end;
}

.villa span {
  display: block;
  width: 34px;
  height: 44px;
  border-top: 12px solid #7b442f;
  background: rgba(255, 255, 255, 0.9);
}

.villa span:nth-child(2) {
  height: 58px;
}

.shore {
  position: absolute;
  right: -40px;
  bottom: -56px;
  left: -40px;
  height: 120px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.55);
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}

.controls,
.comparison-card,
.assumptions-card,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(23, 33, 29, 0.07);
}

.controls {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.controls__heading,
.comparison-card__heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.ghost-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 750;
  padding: 0 14px;
}

.ghost-button:hover {
  border-color: var(--teal);
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd8d2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
}

.field select {
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(23, 124, 114, 0.12);
  outline: none;
}

.field--wide {
  margin-top: 4px;
}

.field-group-title {
  margin: 2px 0 -4px;
  color: var(--ink);
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preset-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(23, 124, 114, 0.18);
  border-radius: 8px;
  background: #eef7f4;
}

.preset-summary strong {
  color: var(--teal-dark);
  font-size: 0.95rem;
}

.preset-summary p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.money-input,
.suffix-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid #cbd8d2;
  border-radius: 8px;
  background: #fff;
}

.suffix-input {
  grid-template-columns: minmax(0, 1fr) auto;
}

.money-input:focus-within,
.suffix-input:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(23, 124, 114, 0.12);
}

.money-input span,
.suffix-input span {
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.money-input input,
.suffix-input input {
  border: 0;
  border-radius: 0;
}

.money-input input:focus,
.suffix-input input:focus {
  box-shadow: none;
}

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

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

.metric {
  display: grid;
  gap: 8px;
  min-height: 134px;
  padding: 18px;
}

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

.metric strong {
  align-self: end;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1;
}

.metric small {
  color: var(--muted);
  font-weight: 700;
}

.metric--solo {
  border-top: 4px solid var(--coral);
}

.metric--consortium {
  border-top: 4px solid var(--teal);
}

.comparison-card,
.assumptions-card {
  overflow: hidden;
}

.comparison-card__heading {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.comparison-card__heading p {
  max-width: 420px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: right;
}

.assumption-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.assumption-panel {
  min-height: 210px;
  background: #fff;
  padding: 18px;
}

.assumption-panel h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 0.9rem;
}

.assumption-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assumption-panel li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(108px, auto);
  gap: 12px;
  align-items: baseline;
}

.assumption-panel li span {
  color: var(--muted);
  font-size: 0.82rem;
}

.assumption-panel li strong {
  color: var(--ink);
  font-size: 0.86rem;
  text-align: right;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #eef5f1;
  color: #33443d;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  font-weight: 720;
}

td:first-child {
  color: var(--muted);
  font-weight: 760;
}

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

.positive {
  color: var(--teal-dark);
}

.negative {
  color: #a83b2c;
}

.disclaimer {
  border: 1px solid rgba(168, 59, 44, 0.22);
  border-radius: 8px;
  background: #fff8f4;
  color: #6f5147;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.55;
  padding: 16px 18px;
}

@media (max-width: 920px) {
  .intro,
  .workspace,
  .summary-grid,
  .assumption-grid {
    grid-template-columns: 1fr;
  }

  .intro__copy {
    min-height: auto;
    padding-bottom: 4px;
  }

  .island-panel {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 16px 0;
  }

  .controls,
  .comparison-card__heading,
  .metric,
  .disclaimer {
    padding: 16px;
  }

  .comparison-card__heading {
    display: grid;
  }

  .comparison-card__heading p {
    text-align: left;
  }

  .assumption-panel {
    min-height: auto;
  }

  .assumption-panel li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .assumption-panel li strong {
    text-align: left;
  }
}
