:root {
  --bg: #f6f4ef;
  --paper: #ffffff;
  --ink: #1d2430;
  --muted: #667085;
  --line: #d7dce2;
  --line-strong: #b8c0cc;
  --brand: #0f766e;
  --brand-dark: #0b4f4a;
  --accent: #9f6b1a;
  --good: #256b4f;
  --warn: #9a5b13;
  --low: #8f2f2f;
  --shadow: 0 18px 40px rgba(29, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

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

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: end;
  padding: 8px 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

.top-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
}

.top-line .eyebrow {
  margin-bottom: 0;
}

.language-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 760;
}

.language-switch a,
.language-switch span {
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--brand-dark);
  text-decoration: none;
}

.language-switch span {
  background: #e9f6f3;
}

.language-switch a:hover {
  background: #f1f4f7;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 4.15rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: #fbfcfa;
  padding: 14px 16px;
  border-radius: 8px;
  color: #3f4856;
  font-size: 0.92rem;
}

.market-context {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #dfe5df;
}

.market-context strong,
.market-context span {
  display: block;
}

.market-context strong {
  margin-bottom: 2px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.market-context span {
  color: #515b68;
  font-weight: 680;
}

.workspace {
  display: grid;
  gap: 18px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.form-panel .panel-heading,
.form-panel fieldset:first-of-type,
.form-panel fieldset:nth-of-type(2),
.form-panel fieldset:nth-of-type(5),
.form-panel .primary-action {
  grid-column: 1 / -1;
}

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

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-heading p.summary-warning {
  border-left: 4px solid var(--warn);
  padding: 9px 11px;
  background: #fff8e8;
  color: #6f450b;
  font-weight: 690;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}

legend {
  margin-bottom: 9px;
  color: #293241;
  font-size: 0.94rem;
  font-weight: 750;
}

.legend-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.segmented,
.option-grid {
  display: grid;
  gap: 8px;
}

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

.segmented.budget-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

label {
  display: block;
}

label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

label span {
  display: flex;
  min-height: 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: #344054;
  background: #fff;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

label input:checked + span {
  border-color: var(--brand);
  background: #e9f6f3;
  color: var(--brand-dark);
  font-weight: 700;
}

label input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
}

label input:focus-visible + span,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.primary-action,
.secondary-action {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 760;
}

.primary-action {
  width: 100%;
  min-height: 46px;
  background: var(--brand);
  color: #fff;
}

.primary-action:hover {
  background: var(--brand-dark);
}

.secondary-action {
  min-width: 78px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
}

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

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  animation: card-in 160ms ease-out both;
}

.scope-card {
  border-color: #f0c36d;
  background: #fffdf8;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confidence-banner {
  margin-bottom: 12px;
  border: 1px solid #f0c36d;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff8e8;
  color: #6f450b;
  font-size: 0.85rem;
  font-weight: 690;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.rank {
  color: var(--brand);
  font-weight: 820;
  font-size: 0.8rem;
}

.result-card h3 {
  margin: 2px 0 5px;
  font-size: 1.25rem;
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.score-pill {
  flex: 0 0 auto;
  min-width: 76px;
  border-radius: 8px;
  padding: 8px 10px;
  background: #eef8f5;
  color: var(--brand-dark);
  text-align: center;
  font-weight: 820;
}

.score-pill small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.fact {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfd;
}

.fact strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.fact span {
  display: block;
  font-weight: 760;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.concession-fact {
  border-color: #f0c36d;
  background: #fff8e8;
}

.value-fact {
  border-color: #b7d7cb;
  background: #f1fbf7;
}

.cost-breakdown {
  margin: 12px 0;
  border: 1px solid #d2dee5;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfd;
}

.cost-breakdown-title {
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.cost-metrics > div {
  min-width: 0;
  border: 1px solid #e0e7eb;
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}

.cost-metrics span,
.cost-metrics em {
  display: block;
}

.cost-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
  text-transform: uppercase;
}

.cost-metrics strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 4px;
  color: #122132;
  font-size: 1.08rem;
}

.cost-metrics small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 760;
}

.cost-metrics em {
  margin-top: 3px;
  color: #516170;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
}

.cost-metric-primary {
  border-color: #b7d7cb !important;
  background: #f3fbf7 !important;
}

.cost-gross,
.cost-excluded,
.cost-caveat {
  margin: 8px 0 0;
  color: #506071;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.cost-excluded {
  color: #6f450b;
}

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

.cost-line-grid h4 {
  margin: 0 0 5px;
  color: var(--brand-dark);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.cost-line-grid ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cost-line-grid li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  align-items: baseline;
  color: #3e4b58;
  font-size: 0.78rem;
  line-height: 1.3;
}

.cost-line-grid li span {
  min-width: 0;
}

.cost-line-grid li strong {
  color: #1e303f;
  font-size: 0.8rem;
}

.cost-line-grid li em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
}

.value-caveat {
  margin: 0;
  border: 1px solid #b7d7cb;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f7fcf9;
  color: #31584d;
  font-size: 0.82rem;
  font-weight: 680;
}

.card-callouts {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.card-callout {
  border: 1px solid #d8e0e6;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  padding: 9px 11px;
  background: #f8fbfb;
}

.card-callout strong,
.card-callout span {
  display: block;
}

.card-callout strong {
  margin-bottom: 3px;
  color: var(--brand-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.card-callout span {
  color: #3f4856;
  font-weight: 700;
  line-height: 1.35;
}

.concession-callout {
  border-color: #f0c36d;
  border-left-color: var(--warn);
  background: #fff8e8;
}

.concession-callout strong {
  color: #6f450b;
}

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

.reason-box {
  border-radius: 8px;
  padding: 10px;
  background: #f8faf8;
}

.reason-box h4 {
  margin: 0 0 6px;
  font-size: 0.84rem;
}

.reason-box ul {
  margin: 0;
  padding-left: 18px;
}

.reason-box li {
  margin-bottom: 4px;
  color: #445061;
  font-size: 0.87rem;
}

.breakdown {
  margin-top: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
  font-size: 0.82rem;
  color: #475467;
}

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

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f1f4f7;
  color: #465466;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag.warn {
  background: #fff4df;
  color: var(--warn);
}

.tag.good {
  background: #e9f6ef;
  color: var(--good);
}

.tag.low {
  background: #fdecec;
  color: var(--low);
}

.method-note {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.method-note h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.criteria-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #3f4856;
  font-size: 0.86rem;
  font-weight: 680;
}

.launch-actions {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}

.action-panel {
  padding: 18px;
}

.field-stack {
  display: grid;
  gap: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: #293241;
  font-size: 0.86rem;
  font-weight: 760;
}

.field-stack input,
.field-stack select,
.field-stack textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

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

.field-stack input:focus-visible,
.field-stack select:focus-visible,
.field-stack textarea:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

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

.action-status {
  min-height: 20px;
  margin: 0;
  color: var(--brand-dark);
  font-size: 0.86rem;
  font-weight: 740;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: -18px auto 28px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .intro,
  .workspace,
  .launch-actions {
    grid-template-columns: 1fr;
  }

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

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

  .budget-grid label:last-child {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  h1 {
    font-size: 2.3rem;
  }

  .segmented,
  .facts,
  .cost-metrics,
  .cost-line-grid,
  .reason-grid,
  .two-col-fields {
    grid-template-columns: 1fr;
  }

  .results-heading,
  .card-top {
    flex-direction: column;
  }

  .score-pill {
    width: 100%;
  }

  .bar-row {
    grid-template-columns: 92px minmax(0, 1fr) 34px;
  }
}
