:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #626873;
  --line: #d9dee7;
  --paper: #f7f7f4;
  --white: #ffffff;
  --green: #147c5b;
  --amber: #b06b18;
  --red: #b82f30;
  --blue: #295f9e;
  --navy: #172233;
}

* { box-sizing: border-box; }

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

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

.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: end;
  padding: 42px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(12, 18, 28, .94), rgba(12, 18, 28, .48)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80") center/cover;
  overflow: hidden;
}

.hero > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
  font-weight: 800;
  color: #9ad7c0;
}

h1 {
  margin: 0;
  max-width: 840px;
  font-size: clamp(36px, 5vw, 72px);
  line-height: .98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.lede {
  max-width: 700px;
  margin: 20px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 19px;
  line-height: 1.45;
}

.score-card,
.assumptions,
.summary > div,
.controls,
.deal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.score-card {
  padding: 22px;
  color: var(--ink);
  width: 100%;
}

.label,
.summary span,
.deal .meta,
.risk,
label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.score-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.score-card small { color: var(--muted); }

.controls {
  margin-top: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 16px;
}

.controls div {
  min-width: 0;
}

label,
output {
  display: block;
}

input[type="range"] {
  width: 100%;
  max-width: 100%;
  margin: 12px 0 8px;
  accent-color: var(--blue);
}

output {
  font-weight: 800;
  color: var(--navy);
}

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

.summary > div {
  padding: 18px;
}

.summary strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.assumptions {
  padding: 20px;
  position: sticky;
  top: 16px;
}

h2 {
  margin: 0;
  font-size: 21px;
}

dl {
  margin: 18px 0;
}

dl div {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 5px 0 0;
  font-weight: 750;
}

button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

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

#updated {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

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

.deal {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(230px, 1.2fr) repeat(5, minmax(110px, 1fr)) minmax(170px, 1.2fr);
  gap: 14px;
  align-items: center;
}

.deal h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 32px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status.pencil { color: #fff; background: var(--green); }
.status.watch { color: #211502; background: #f1c36c; }
.status.pass { color: #fff; background: var(--red); }

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

.risk {
  padding: 6px 8px;
  border-radius: 999px;
  background: #eef1f6;
  color: #48505b;
}

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

  .controls,
  .summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .assumptions {
    position: static;
  }

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

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 10px;
  }

  .hero {
    padding: 26px;
    min-height: 520px;
  }

  h1 {
    max-width: min(100%, 300px);
    font-size: 31px;
    line-height: 1.04;
    overflow-wrap: normal;
  }

  .lede {
    max-width: min(100%, 300px);
    font-size: 17px;
  }

  .score-card {
    max-width: min(100%, 300px);
  }

  .controls,
  .controls div,
  input {
    min-width: 0;
  }

  .controls,
  .summary,
  .deal {
    grid-template-columns: 1fr;
  }
}
