:root {
  color-scheme: light;
  --paper: #f3f4ee;
  --sheet: #fdfdf9;
  --white: #fff;
  --ink: #172e27;
  --muted: #53665c;
  --line: #d4dbd2;
  --dark: #18312b;
  --dark-line: #476057;
  --night-text: #eaf1e8;
  --night-muted: #c4d5c9;
  --accent: #def2a3;
  --focus: #3c7865;
  --warn: #ffe1a5;
  --issue: #ffd3cb;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.frame { width: min(100% - 4rem, 78rem); margin-inline: auto; }
.masthead { background: var(--dark); color: var(--night-text); }
.masthead-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 730; letter-spacing: -.025em; white-space: nowrap; }
.brand-mark {
  width: 1.3rem;
  height: 1.3rem;
  display: inline-block;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 29%, 33% 29%, 33% 46%, 83% 46%, 83% 73%, 33% 73%, 33% 100%, 0 100%);
}
.header-actions { display: flex; align-items: center; gap: .5rem; }
.button {
  border: 1px solid transparent;
  border-radius: .375rem;
  min-height: 2.5rem;
  padding: .5rem .8rem;
  font-size: .875rem;
  font-weight: 680;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.button-quiet { color: var(--night-text); background: transparent; }
.button-quiet:hover, .button-rail:hover { background: #2e4a40; }
.button-light { color: var(--dark); background: var(--night-text); }
.button-light:hover { background: var(--accent); }
.button-outline { background: var(--sheet); border-color: #a3b2a7; }
.button-outline:hover { background: #edf2e8; border-color: #73887a; }
.button-solid { color: var(--white); background: var(--dark); }
.button-solid:hover { background: #33564a; }
.button-accent { color: var(--dark); background: var(--accent); }
.button-accent:hover { background: #effbcf; }
.button-rail { border-color: #789385; color: var(--night-text); background: transparent; }
button[disabled] { cursor: default; opacity: .55; }
.masthead :focus-visible, .decision :focus-visible { outline-color: var(--accent); }

.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  padding: 3.05rem 0 1.9rem;
}
.eyebrow { font-size: .8125rem; line-height: 1.25; font-weight: 730; letter-spacing: .065em; text-transform: uppercase; }
.intro .eyebrow { color: #406254; margin-bottom: .55rem; }
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 5.1vw, 4.55rem);
  font-weight: 400;
  line-height: .99;
  letter-spacing: -.064em;
  text-wrap: balance;
}
.intro-copy { color: var(--muted); margin-top: .8rem; font-size: 1.025rem; }
.privacy-note { color: #435a4e; font-size: .875rem; display: flex; align-items: center; gap: .48rem; flex: 0 0 auto; padding-bottom: .12rem; }
.storage-mark { width: .6rem; height: .6rem; border: 1.5px solid currentColor; border-radius: 50%; }

.section-nav { display: flex; flex-wrap: wrap; column-gap: 1.4rem; align-items: center; border-block: 1px solid #c8d1c7; margin-bottom: 1.25rem; }
.section-nav a { font-size: .875rem; font-weight: 670; text-underline-offset: .2em; text-decoration: none; min-height: 2.625rem; padding-block: .65rem; }
.section-nav a:hover { text-decoration: underline; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 21.5rem); align-items: start; gap: 1.25rem; }
.editing { display: grid; gap: 1rem; min-width: 0; }
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: .625rem; padding: 1.3rem 1.45rem 1.45rem; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: .75rem; margin-bottom: 1.05rem; }
h2 { font-size: 1.35rem; line-height: 1.13; letter-spacing: -.032em; font-weight: 720; }
.section-head p { font-size: .875rem; color: var(--muted); margin-top: .32rem; }
.section-head .button { white-space: nowrap; }
.case-state { font-size: .8125rem; font-weight: 710; background: #e9efdf; color: #3d553e; padding: .23rem .5rem; border-radius: .25rem; white-space: nowrap; }

.case-fields, .candidate-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; }
.commercial-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem 1rem; }
.field { display: grid; align-content: start; min-width: 0; gap: .33rem; }
.field > span { font-size: .875rem; font-weight: 650; }
.field-wide { grid-column: 1 / -1; }
input:not([type=file]), select, textarea {
  color: var(--ink);
  background-color: var(--white);
  border: 1px solid #bac8bb;
  border-radius: .32rem;
  min-height: 2.55rem;
  padding: .5rem .6rem;
  width: 100%;
  min-width: 0;
  font-size: .9375rem;
  line-height: 1.3;
}
input::placeholder, textarea::placeholder { color: #697b70; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: #849b89; }
textarea { resize: vertical; min-height: 3.8rem; }
select {
  appearance: none;
  padding-right: 1.5rem;
  background-image: linear-gradient(45deg, transparent 50%, #4f6759 50%), linear-gradient(135deg, #4f6759 50%, transparent 50%);
  background-position: calc(100% - .875rem) 50%, calc(100% - .625rem) 50%;
  background-size: .25rem .25rem;
  background-repeat: no-repeat;
}
.help { color: var(--muted); margin-top: .45rem; font-size: .875rem; }

.criteria-head, .criterion { display: grid; grid-template-columns: minmax(8rem, 1.42fr) minmax(6.6rem, .8fr) minmax(3rem, .35fr) minmax(5rem, .88fr) 2rem; gap: .55rem; align-items: start; }
.criteria-head { border-bottom: 1px solid var(--line); padding-bottom: .45rem; color: var(--muted); font-size: .8125rem; font-weight: 650; }
.criterion { padding-top: .55rem; }
.limit-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .28rem; }
.limit-pair input { padding-inline: .35rem; }
.manual-limit { padding: .62rem 0 .15rem; color: var(--muted); font-size: .8125rem; }
.remove { display: grid; place-content: center; min-height: 2.55rem; width: 2rem; background: transparent; border: 1px solid transparent; border-radius: .32rem; cursor: pointer; color: #53675c; font-size: 1.3rem; line-height: 1; }
.remove:hover { background: #f9eee9; color: #713e34; }
.mobile-label { display: none; }
.empty { border-top: 1px solid var(--line); color: var(--muted); padding-top: .75rem; font-size: .9375rem; }

.candidate { border-top: 1px solid var(--line); padding-top: .8rem; }
.candidate + .candidate { margin-top: 1.35rem; }
.candidate-head { display: flex; justify-content: space-between; align-items: center; min-height: 2.5rem; gap: .75rem; margin-bottom: .5rem; }
.candidate-head h3 { font-size: 1.04rem; overflow-wrap: anywhere; }
.results { margin-top: .95rem; }
.results-head, .result { display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(5.1rem, .65fr) minmax(6.5rem, 1.2fr) minmax(4rem, .43fr); gap: .55rem; align-items: center; }
.results-head { font-size: .8125rem; font-weight: 650; padding-bottom: .4rem; color: var(--muted); }
.result { padding-block: .45rem; border-top: 1px solid var(--line); }
.result-name { font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; }
.result-name small { display: block; font-size: .8125rem; color: var(--muted); font-weight: 450; }
.result-status { justify-self: start; font-weight: 695; font-size: .8125rem; }
.result-status.pass { color: #2f5b36; }
.result-status.fail { color: #8c392c; }
.result-status.pending { color: #5d6c60; }

.decision { background: var(--dark); color: var(--night-text); border-radius: .625rem; position: sticky; top: 1rem; min-width: 0; }
.decision-head { padding: 1.35rem 1.25rem .9rem; }
.decision-head .eyebrow { color: var(--accent); font-size: .75rem; margin-bottom: .42rem; }
.decision h2 { font-size: 1.65rem; }
.decision-head p:last-child { color: var(--night-muted); font-size: .875rem; margin-top: .35rem; }
.comparison-list { padding-inline: 1.25rem; }
.comparison-item { border-top: 1px solid var(--dark-line); padding: .85rem 0 .92rem; }
.comparison-top { display: flex; align-items: start; justify-content: space-between; gap: .55rem; }
.comparison-item h3 { font-size: 1rem; overflow-wrap: anywhere; min-width: 0; }
.compare-pill { font-size: .75rem; white-space: nowrap; padding: .18rem .38rem; font-weight: 730; border-radius: .25rem; background: #3d5b50; color: #fff; }
.compare-pill.pass { color: var(--dark); background: var(--accent); }
.compare-pill.fail { color: #4a2924; background: var(--issue); }
.compare-pill.pending { color: #422e13; background: var(--warn); }
.compare-sub, .compare-empty { color: var(--night-muted); font-size: .875rem; margin-top: .3rem; }
.compare-empty { border-top: 1px solid var(--dark-line); padding-block: .9rem; margin: 0; }
.cost { margin-top: .37rem; font-size: .91rem; font-weight: 660; font-variant-numeric: tabular-nums; }
.cost span { display: block; color: var(--night-muted); font-size: .8125rem; font-weight: 440; margin-top: .12rem; }
.decision-actions { display: grid; gap: .48rem; padding: .78rem 1.25rem 0; border-top: 1px solid var(--dark-line); }
.decision-foot { margin: .65rem 1.25rem 1.15rem; font-size: .8125rem; color: var(--night-muted); }
.footer { display: flex; justify-content: space-between; align-items: center; gap: .8rem; color: var(--muted); font-size: .875rem; padding: .85rem 0 1.7rem; }
.footer div { display: flex; gap: 1rem; }
.text-button { border: 0; padding: .3rem 0; background: none; color: inherit; font-weight: 660; cursor: pointer; text-decoration: underline; text-underline-offset: .22em; }
.sr-only, .skip-link:not(:focus) { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 5; top: .5rem; left: .5rem; background: var(--white); padding: .5rem; }
dialog { color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: .625rem; width: min(calc(100% - 2rem), 26rem); padding: 1.4rem; }
dialog::backdrop { background: rgb(23 46 39 / .52); }
dialog p { color: var(--muted); margin-top: .7rem; }
.dialog-actions { display: flex; justify-content: end; gap: .5rem; margin-top: 1rem; }
.print-view { display: none; }

@media (max-height: 50rem) { .decision { position: static; } }
@media (max-width: 64rem) {
  .frame { width: calc(100% - 2.5rem); }
  .workbench { grid-template-columns: minmax(0, 1fr) minmax(15.75rem, 17rem); gap: .85rem; }
  .panel { padding-inline: 1.05rem; }
}
@media (max-width: 56rem) {
  .workbench { display: flex; flex-direction: column; gap: 1rem; }
  .decision, .editing { width: 100%; }
  .decision { position: static; }
  .intro { padding-top: 2.25rem; }
}
@media (max-width: 39rem) {
  .frame { width: calc(100% - 1.5rem); }
  .masthead-inner { min-height: 3.75rem; gap: .32rem; }
  .brand { font-size: .875rem; gap: .38rem; }
  .brand-mark { width: .95rem; height: .95rem; }
  .header-actions { gap: .12rem; }
  .header-actions .button { padding: .45rem .43rem; font-size: .8125rem; }
  .intro { display: block; padding: 1.85rem 0 1.3rem; }
  .intro-copy { margin-top: .65rem; }
  .privacy-note { margin-top: .68rem; }
  .section-nav { column-gap: .7rem; margin-bottom: .85rem; }
  .section-nav a { font-size: .8125rem; }
  .panel { padding: .95rem .8rem; }
  .section-head .button { padding-inline: .5rem; }
  .case-fields, .candidate-fields, .commercial-fields { gap: .65rem; }
  .commercial-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-fields .field, .candidate-fields .field, .commercial-fields .field { min-width: 0; }
  .criteria-head, .results-head { display: none; }
  .criterion { grid-template-columns: repeat(2, minmax(0, 1fr)) 1.65rem; gap: .55rem; padding-block: .65rem; border-top: 1px solid var(--line); }
  .criterion > :first-child { grid-column: 1 / 3; }
  .criterion > :nth-child(2) { grid-column: 1; }
  .criterion > :nth-child(3) { grid-column: 2; }
  .criterion > :nth-child(4) { grid-column: 1 / 3; }
  .criterion > :last-child { grid-column: 3; grid-row: 1; align-self: end; width: 1.65rem; }
  .mobile-label { display: block; font-size: .8125rem; font-weight: 650; }
  .result { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .result-name { grid-column: 1; grid-row: 1; }
  .result-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .result-name small { display: inline; }
  .decision-actions { grid-template-columns: 1fr 1fr; }
  input:not([type=file]), select, textarea { font-size: 1rem; }
}
@media (max-width: 24rem) {
  .decision-actions { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print {
  body { background: #fff; color: #111; font: 11pt/1.45 system-ui, sans-serif; }
  body > :not(.print-view) { display: none !important; }
  .print-view { display: block; }
  .print-view h1 { font: 30pt/1.1 Georgia, serif; letter-spacing: -.02em; margin-bottom: .4em; }
  .print-view h2 { font-size: 15pt; margin-top: 1em; }
  .print-view p { margin: .35em 0; overflow-wrap: anywhere; }
  .print-view table { border-collapse: collapse; width: 100%; margin-top: .5em; }
  .print-view th, .print-view td { border-bottom: 1px solid #aaa; text-align: left; padding: .35em .45em; }
  .print-view tr { break-inside: avoid; }
}

.flash {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: min(calc(100% - 2rem), 29rem);
  padding: .75rem .9rem;
  border: 1px solid #a9644f;
  border-radius: .4rem;
  background: #fff1e8;
  color: #68382c;
  box-shadow: 0 .4rem 1.2rem rgb(43 30 21 / .14);
}
