:root {
  --ink: #16211f;
  --muted: #5c6a67;
  --line: #d7dfdc;
  --paper: #f7faf8;
  --white: #ffffff;
  --green: #2f7b5f;
  --teal: #166b78;
  --red: #b73535;
  --yellow: #b78121;
  --shadow: 0 18px 45px rgba(22, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

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

button {
  border: 0;
  border-radius: 8px;
  padding: 0.72rem 1rem;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  filter: brightness(0.95);
}

button.secondary {
  background: #e5ece9;
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.topbar p,
.standard-note {
  margin: 0;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.standard-note {
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.92rem;
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 330px;
  padding: clamp(1.4rem, 5vw, 4rem);
  background: #eaf3ef;
  border: 1px solid var(--line);
}

.intro-copy h2 {
  max-width: 12ch;
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1;
}

.intro-copy p {
  max-width: 48rem;
  margin: 0 0 1.4rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.intro-image {
  min-height: 330px;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
}

.intro-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 330px;
  object-fit: cover;
}

.profile-panel,
.controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-panel h2,
.profile-panel p,
.section-heading h2,
.section-heading p,
.clause-list h2 {
  margin: 0;
}

.profile-panel p,
.section-heading p {
  color: var(--muted);
}

.profile-grid,
.controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.controls {
  align-items: end;
}

.controls label:last-child {
  grid-column: span 2;
}

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

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.72rem 0.78rem;
  color: var(--ink);
  background: var(--white);
}

textarea {
  resize: vertical;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric {
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 0.2rem 0;
  font-size: 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.clause-list {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.clause-progress {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.clause-progress:last-child {
  border-bottom: 0;
}

.clause-progress div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 700;
}

.bar {
  height: 0.55rem;
  overflow: hidden;
  background: #e4ebe8;
  border-radius: 999px;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.assessment {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

#requirements {
  display: grid;
  gap: 1rem;
}

.requirement-card {
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.requirement-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.clause-tag {
  margin: 0 0 0.25rem;
  color: var(--teal);
  font-weight: 700;
}

.requirement-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: #eef3f1;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill.gap {
  background: #fdecec;
  color: var(--red);
}

.status-pill.partial {
  background: #fff5dd;
  color: var(--yellow);
}

.status-pill.met {
  background: #e6f4ee;
  color: var(--green);
}

.requirement-prompt {
  margin: 0.75rem 0;
  color: var(--muted);
}

.score-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.score-option {
  position: relative;
}

.score-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.score-option span {
  display: block;
  height: 100%;
  min-height: 4.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem;
  color: var(--muted);
  cursor: pointer;
}

.score-option strong {
  display: block;
  color: var(--ink);
}

.score-option input:checked + span {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--green);
  background: #f0f8f4;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.field-grid label:nth-child(-n + 3) {
  grid-column: span 1;
}

.hide {
  display: none;
}

@media (max-width: 1000px) {
  .intro-band,
  .content-grid,
  .profile-panel {
    grid-template-columns: 1fr;
  }

  .clause-list {
    position: static;
  }

  .dashboard,
  .profile-grid,
  .controls,
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .controls label:last-child {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .topbar,
  .section-heading,
  .requirement-head {
    display: grid;
  }

  .dashboard,
  .profile-grid,
  .controls,
  .field-grid,
  .score-row {
    grid-template-columns: 1fr;
  }

  .controls label:last-child {
    grid-column: span 1;
  }

  .intro-copy,
  .intro-image,
  .intro-image img {
    min-height: 260px;
  }

  .field-grid label:nth-child(-n + 3) {
    grid-column: span 1;
  }
}

@media print {
  body {
    background: #fff;
  }

  .actions,
  .controls,
  .intro-image {
    display: none;
  }

  .topbar,
  .intro-band,
  .profile-panel,
  .dashboard,
  .content-grid {
    display: block;
  }

  .metric,
  .requirement-card,
  .profile-panel,
  .clause-list,
  .intro-copy {
    box-shadow: none;
    break-inside: avoid;
  }
}
