:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #2d2925;
  background: #f3f0ea;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #f3f0ea;
}

body {
  margin: 0;
  min-width: 0;
  background: #f3f0ea;
  color: #2d2925;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
}

main {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

header,
section {
  margin: 0 0 1.5rem;
  padding: 1.75rem 2rem;
  overflow-wrap: anywhere;
  background: #ffffff;
  border: 1px solid #ded8cf;
  border-radius: 0.75rem;
  box-shadow: 0 0.125rem 0.5rem rgba(54, 43, 35, 0.06);
}

h1,
h2,
h3 {
  margin-top: 0;
  color: #35251d;
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  margin-bottom: 1rem;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

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

h3 {
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

p {
  max-width: 72ch;
  margin-top: 0;
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.6rem;
}

a {
  color: #6b351f;
  text-decoration-line: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}

a:focus-visible {
  outline: 0.1875rem solid #8a4f22;
  outline-offset: 0.1875rem;
  border-radius: 0.125rem;
}

small {
  display: inline-block;
  color: #5e5750;
  font-size: 0.875rem;
  line-height: 1.55;
}

small a {
  font-weight: 600;
  text-decoration-line: underline;
}

section[aria-labelledby="emergency-heading"] {
  background: #fff2f0;
  border-color: #e7b4ae;
  border-left: 0.375rem solid #b42318;
  box-shadow: 0 0.125rem 0.5rem rgba(120, 28, 20, 0.07);
}

section[aria-labelledby="emergency-heading"] h2 {
  color: #8c1d16;
}

section[aria-labelledby="emergency-heading"] a[href^="tel:"] {
  display: inline-flex;
  min-height: 3rem;
  margin-top: 0.25rem;
  padding: 0.6rem 0.85rem;
  align-items: center;
  color: #7a1813;
  background: #ffffff;
  border: 1px solid #ca675d;
  border-radius: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

section[aria-labelledby="calculator-heading"] {
  border-color: #a98a70;
  border-top: 0.25rem solid #694631;
  box-shadow: 0 0.25rem 0.875rem rgba(64, 46, 35, 0.09);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

form > div,
fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  background: #faf8f5;
  border: 1px solid #ddd5cc;
  border-radius: 0.625rem;
}

fieldset {
  display: block;
}

legend {
  padding: 0 0.35rem;
  color: #3b2b22;
  font-size: 1rem;
  font-weight: 700;
}

label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  color: #342820;
  font-weight: 650;
}

fieldset > legend + label,
form > div > label:first-child {
  margin-top: 0;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.75rem;
  color: #2d2925;
  background: #ffffff;
  border: 1px solid #746b62;
  border-radius: 0.5rem;
  font-size: 1rem;
  line-height: 1.3;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 0.1875rem solid #8a4f22;
  outline-offset: 0.125rem;
}

input:focus-visible,
select:focus-visible {
  border-color: #513426;
}

form > p {
  margin-bottom: 0;
}

[role="alert"] {
  margin-top: 0.6rem;
  margin-bottom: 0;
  padding: 0.6rem 0.75rem;
  color: #831c16;
  background: #fff1ef;
  border-left: 0.25rem solid #b42318;
  font-weight: 650;
}

button {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 1rem;
  color: #ffffff;
  background: #4d3325;
  border: 1px solid #4d3325;
  border-radius: 0.5rem;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  color: #625d57;
  background: #d9d5d0;
  border-color: #c7c1ba;
  cursor: not-allowed;
}

#results {
  background: #fbfaf7;
  border-color: #a98a70;
  border-top: 0.25rem solid #694631;
}

#results article {
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  background: #ffffff;
  border: 1px solid #d9d2ca;
  border-left: 0.35rem solid #8b654b;
  border-radius: 0.625rem;
}

#results article:first-of-type {
  margin-top: 0;
}

#result-40-to-60 {
  border-left-color: #a24b18;
}

#result-60-or-more,
#result-undetermined {
  border-left-color: #a3231a;
}

table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  overflow-x: auto;
  border: 1px solid #d9d2ca;
  border-collapse: collapse;
  background: #ffffff;
  white-space: nowrap;
}

caption {
  padding: 0.75rem;
  color: #3a2b22;
  background: #f5f1ec;
  font-weight: 700;
  text-align: left;
}

th,
td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #ddd6ce;
  text-align: left;
  vertical-align: top;
}

thead th {
  color: #31261f;
  background: #eee8e1;
}

tbody th {
  font-weight: 650;
}

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

section[aria-labelledby="other-risks-heading"] > ul {
  margin-bottom: 0;
}

section[aria-labelledby="other-risks-heading"] > ul > li {
  padding: 0.9rem 0;
}

section[aria-labelledby="other-risks-heading"] > ul > li + li {
  margin-top: 0;
  border-top: 1px solid #e2dcd5;
}

section[aria-labelledby="other-risks-heading"] li p {
  margin-top: 0.6rem;
}

@media (max-width: 640px) {
  main {
    padding: 1rem 1rem 2rem;
  }

  header,
  section {
    margin-bottom: 1rem;
    padding: 1.25rem;
    border-radius: 0.625rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  form {
    gap: 1rem;
  }

  form > div,
  fieldset {
    padding: 0.875rem;
  }

  input,
  select,
  button {
    min-height: 3rem;
  }

  table {
    font-size: 0.9375rem;
  }

  th,
  td {
    padding: 0.65rem 0.75rem;
  }
}
