:root {
  font-family: "DM Sans", Arial, sans-serif;
  color: #1f2c2b;
  background: #f4f6f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #1f2c2b;
  --muted: #71807b;
  --green: #1f5949;
  --lime: #c4f070;
  --line: #e2e8e1;
  --paper: #fff;
  --serif: "Manrope", Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 320px;
}
.site-header,
main,
footer {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
}
.site-header {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8e180;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-family: var(--serif);
  font-size: 18px;
}
.header-link {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.header-link:hover {
  text-decoration: underline;
}
.site-header nav,
.hero-links,
.export-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.hero-links {
  margin-top: 20px;
  font-size: 13px;
  font-weight: 600;
}
.hero-links a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.hero {
  padding: 62px 0 32px;
  max-width: 650px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 700;
  color: #6c8278;
  margin: 0 0 11px;
}
.hero h1,
.section-heading h2,
.rules-section h2 {
  font-family: var(--serif);
  letter-spacing: -0.045em;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.06;
  margin: 0 0 14px;
  font-weight: 700;
  max-width: 600px;
}
.intro {
  color: #687671;
  line-height: 1.65;
  font-size: 15px;
  margin: 0;
  max-width: 560px;
}
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 5px 22px #21372d08;
}
.card-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.step {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #edf3ed;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}
.card-heading h2 {
  font-size: 17px;
  margin: 2px 0 4px;
  letter-spacing: -0.02em;
}
.card-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field {
  min-width: 0;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  height: 46px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid #dce4dc;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.field textarea {
  height: auto;
  min-height: 150px;
  resize: vertical;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.55;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #1f59491a;
}
.field small {
  display: block;
  color: #7c8984;
  font-size: 10px;
  line-height: 1.4;
  margin-top: 6px;
  min-height: 28px;
}
.grade-field {
  margin-top: 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 14px;
  margin-top: 14px;
}
.threshold-field {
  grid-column: 1 / -1;
}
.source-note {
  margin: 14px 0;
  padding: 14px;
  border-radius: 9px;
  background: #f0f4ed;
  font-size: 11px;
  line-height: 1.55;
}
.source-note p {
  margin: 6px 0;
}
.source-note a {
  color: var(--green);
  overflow-wrap: anywhere;
}
.source-date {
  color: #5d6b64;
}
.error {
  min-height: 18px;
  margin: 8px 0 4px;
  color: #ac3d36;
  font-size: 12px;
}
.button {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font:
    600 13px "DM Sans",
    sans-serif;
  cursor: pointer;
  transition:
    transform 0.15s,
    background 0.15s;
}
.button:hover {
  transform: translateY(-1px);
}
.button:focus-visible {
  outline: 3px solid #4b916f;
  outline-offset: 3px;
}
.primary {
  width: 100%;
  background: var(--green);
  color: white;
}
.primary:hover {
  background: #184536;
}
.secondary {
  background: #edf3ed;
  color: var(--green);
  white-space: nowrap;
}
.secondary:hover {
  background: #e1eae1;
}
.result-card {
  position: relative;
  overflow: hidden;
  background: #1f5949;
  color: #fff;
  border-color: #1f5949;
}
.result-card::after {
  content: "";
  position: absolute;
  right: -55px;
  top: -75px;
  width: 210px;
  height: 210px;
  border: 1px solid #ffffff1c;
  border-radius: 50%;
  box-shadow:
    0 0 0 28px #ffffff08,
    0 0 0 56px #ffffff06;
  pointer-events: none;
}
.result-card .step {
  color: #254b3d;
  background: #c4f070;
}
.result-card .card-heading p {
  color: #c1d2ca;
}
.result-empty {
  height: 181px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: #cad9d1;
  position: relative;
  z-index: 1;
}
.result-empty span {
  font-size: 28px;
  color: #c4f070;
}
.result-empty p {
  font-size: 14px;
  max-width: 220px;
  line-height: 1.6;
  margin: 12px 0;
}
.result-value {
  height: 181px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.result-value > span {
  font-size: 12px;
  color: #cbdbd2;
}
.result-value strong {
  font-family: var(--serif);
  font-size: 76px;
  line-height: 1.15;
  letter-spacing: -0.06em;
  color: #d1f58c;
}
.result-value p {
  font-size: 12px;
  color: #d6e1dc;
  margin: 8px 0 0;
}
.result-foot {
  border-top: 1px solid #ffffff27;
  padding-top: 14px;
  font-size: 10px;
  color: #c6d6ce;
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: #c4f070;
  border-radius: 50%;
}
.table-section {
  padding: 66px 0 0;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 20px;
}
.section-heading h2,
.rules-section h2 {
  margin: 0 0 7px;
  font-size: clamp(25px, 4vw, 34px);
}
.section-heading > div > p:last-child {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.table-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.table-meta {
  min-height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.table-meta strong {
  color: var(--ink);
  font-size: 11px;
}
.meta-divider {
  height: 17px;
  width: 1px;
  background: var(--line);
  margin: 0 7px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
thead {
  background: #f7f9f6;
  color: #79857f;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
th {
  font-weight: 600;
}
th,
td {
  padding: 13px 20px;
  border-bottom: 1px solid #edf0ec;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.grade-cell {
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
}
.grade-chip {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: #edf4ea;
}
.range-cell {
  color: #64716b;
}
.table-note {
  margin: 0;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #748079;
  line-height: 1.5;
}
.print-context {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.55;
}
.print-context p {
  margin: 0 0 5px;
}
.print-context a {
  color: #234f40;
  overflow-wrap: anywhere;
}
.rules-section {
  padding: 70px 0 50px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  column-gap: 42px;
  row-gap: 18px;
  align-items: center;
}
.rules-copy p:last-child {
  font-size: 13px;
  color: #66736e;
  line-height: 1.7;
  margin: 10px 0 0;
}
.formula-card {
  border: 1px solid #dce6da;
  background: #eef3eb;
  border-radius: 12px;
  padding: 18px;
}
.formula-card > span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #668073;
}
.formula-card code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #234f40;
  font-size: clamp(11px, 1.5vw, 14px);
  line-height: 1.7;
  margin: 10px 0;
}
.formula-card p {
  font-size: 11px;
  line-height: 1.6;
  color: #64716b;
  margin: 0;
}
.disclaimer {
  grid-column: 1/-1;
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: #76817d;
  font-size: 11px;
  line-height: 1.6;
}
footer {
  border-top: 1px solid var(--line);
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #71807b;
  font-size: 10px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 700px) {
  .site-header,
  main,
  footer {
    width: min(100% - 32px, 520px);
  }
  .site-header {
    height: 64px;
  }
  .site-header nav {
    gap: 10px;
  }
  .header-link {
    font-size: 11px;
  }
  .hero-links {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .hero {
    padding: 44px 0 24px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card {
    padding: 20px;
  }
  .result-empty,
  .result-value {
    height: 140px;
  }
  .table-section {
    padding-top: 50px;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .section-heading .button {
    width: 100%;
  }
  .export-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .table-meta {
    padding: 0 14px;
    font-size: 10px;
    gap: 6px;
  }
  .table-meta strong {
    font-size: 10px;
  }
  th,
  td {
    padding: 12px 14px;
  }
  .table-note {
    padding: 12px 14px;
  }
  .rules-section {
    padding: 52px 0 36px;
    grid-template-columns: 1fr;
    row-gap: 16px;
  }
  .disclaimer {
    grid-column: auto;
  }
  footer {
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}
@media (max-width: 380px) {
  .field-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .field small {
    min-height: 0;
    margin-bottom: 8px;
  }
  .table-meta {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .meta-divider {
    margin: 0 2px;
  }
  th,
  td {
    padding-inline: 10px;
  }
}
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .site-header,
  .hero,
  .workspace,
  .rules-section,
  footer,
  .section-heading .button {
    display: none !important;
  }
  .print-context {
    padding: 10px 12px;
  }
  main {
    width: 100%;
    margin: 0;
  }
  .table-section {
    padding: 0;
  }
  .section-heading {
    display: block;
    margin: 0 0 12px;
  }
  .section-heading .eyebrow {
    display: none;
  }
  .section-heading h2 {
    font-size: 22px;
  }
  .section-heading > div > p:last-child {
    color: #444;
  }
  .table-card {
    border: 1px solid #999;
    border-radius: 0;
  }
  .table-meta {
    border-color: #999;
  }
  .table-note {
    color: #444;
    border-color: #999;
  }
  thead {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  th,
  td {
    padding: 8px 12px;
    border-color: #ccc;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
