:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #111110;
  background: #fafaf8;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
header { background: #fff; border-bottom: 1px solid rgba(0,0,0,.08); }
header .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding-block: .9rem; }
header span, p { color: #615d59; }
.wrap { width: min(100% - 2rem, 44rem); margin-inline: auto; }
main { padding-block: 2.5rem; }
.intro { margin-bottom: 1.5rem; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.2; margin: 0; }
h2 { font-size: 1.125rem; margin: 0 0 1rem; }
section { padding: clamp(1rem, 4vw, 1.75rem); border: 1px solid rgba(0,0,0,.08); border-radius: 12px; background: #fff; }
form, label { display: grid; gap: .45rem; }
form { gap: .9rem; }
label { font-weight: 600; }
input, textarea, select, button { font: inherit; }
input, textarea, select { width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid #8a857f; border-radius: 6px; background: #fff; color: inherit; }
textarea { resize: vertical; }
button { justify-self: start; min-height: 44px; border: 1px solid transparent; border-radius: 6px; padding: .55rem 1rem; cursor: pointer; background: #084734; color: #fff; }
button:hover { background: #065c41; }
button.secondary { color: #084734; background: #fff; border-color: #8a857f; }
a { color: #084734; }
:focus-visible { outline: 2px solid #084734; outline-offset: 3px; }
#capture-help { margin: -.55rem 0 0; font-size: .875rem; }
.form-error { color: #b43e3e; margin: 0; }
#preview { max-width: 100%; max-height: 12rem; object-fit: contain; }
.test-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1rem; }
.test-actions + .result + input { margin-top: .65rem; }

header .brand { color: #111110; font-weight: 700; text-decoration: none; }
header .brand:hover { text-decoration: underline; }
.scenario-list, .settlements { list-style: none; margin: 0; padding: 0; }
.scenario-list { display: grid; gap: .65rem; }
.scenario-link {
  position: relative;
  display: block;
  padding: .95rem 2.75rem .95rem 1rem;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 6px;
  background: #fff;
  color: #111110;
  text-decoration: none;
}
.scenario-link::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  top: calc(50% - .25rem);
  width: .5rem;
  height: .5rem;
  border: solid #084734;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
.scenario-link:hover { border-color: #084734; }
.scenario-title { display: flex; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; }
.scenario-title h2, .scenario-link p, .settlements p { margin: 0; }
.scenario-link p { margin-top: .25rem; font-size: .95rem; }
.category, .scenario-context, .field-note { color: #615d59; font-size: .875rem; }
.scenario-context { display: flex; justify-content: space-between; gap: .75rem; margin: -.85rem 0 .9rem; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin: -.75rem 0 .4rem; }
.empty { border-block: 1px solid rgba(0,0,0,.08); padding-block: 1rem; }
.control-row { display: grid; gap: .75rem; }
.control-row > * { min-width: 0; }
@media (min-width: 32rem) { .control-row { grid-template-columns: 1fr 1fr; } }
.field-note { margin: 0; }
.totals { margin: 1.25rem 0 0; }
.totals > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .total { border-top: 1px solid rgba(0,0,0,.08); font-weight: 700; }
.result { margin: .9rem 0 0; color: #084734; font-weight: 600; }
.result:empty, .form-error:empty { display: none; }
button:disabled { cursor: not-allowed; color: #615d59; background: #f0f0ec; }
table { width: 100%; border-collapse: collapse; margin-top: .65rem; font-size: .875rem; }
th, td { padding: .5rem 0; border-bottom: 1px solid rgba(0,0,0,.08); text-align: left; font-variant-numeric: tabular-nums; }
th:last-child, td:last-child { text-align: right; }
.settlements li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; align-items: center; border-top: 1px solid rgba(0,0,0,.08); padding: .9rem 0; }
.settlements li:first-child { margin-top: .9rem; }
.settlements li:last-child { padding-bottom: 0; }
.completion { color: #084734; font-weight: 600; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.quote-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.quote-actions [aria-pressed="true"] { border-color: #084734; color: #084734; background: #ecfdf5; }
.quote-actions[hidden], form[hidden] { display: none; }
.quote-heading { margin: 1.2rem 0 .75rem; }
.quote-heading h2 { margin: 0 0 .2rem; overflow-wrap: anywhere; }
.quote-heading p { margin: 0; }
.quote-heading ~ .quote-actions { margin-top: .9rem; }
.quote-share-state { margin: .75rem 0 0; }
.quote-share-state:empty { display: none; }
.quote-reset { margin-top: 1rem; }
dialog { width: min(calc(100% - 2rem), 27rem); padding: 1.25rem; border: 1px solid rgba(0,0,0,.16); border-radius: 6px; color: #111110; background: #fff; }
dialog::backdrop { background: rgba(17,17,16,.48); }
