:root {
  color-scheme: light;
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --surface-blue: #eef5fb;
  --text: #18201d;
  --muted: #5f6863;
  --line: #d9dfd7;
  --line-strong: #b9c6bd;
  --accent: #216e55;
  --accent-dark: #164937;
  --accent-soft: #dceee6;
  --blue: #2d6f9f;
  --amber: #b45f14;
  --danger: #9f2d20;
  --focus: #b45f14;
  --shadow: 0 18px 46px rgba(24, 32, 29, 0.1);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 72px;
}

.brand,
.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 780;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.8rem;
}

.site-nav,
.site-footer nav {
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.intro-band {
  position: relative;
  display: grid;
  min-height: 320px;
  overflow: hidden;
  border-radius: 8px;
  background: #14231e;
  isolation: isolate;
}

.intro-band img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-band::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgba(11, 24, 20, 0.8), rgba(11, 24, 20, 0.48) 48%, rgba(11, 24, 20, 0.14));
}

.intro-copy {
  align-self: end;
  max-width: 660px;
  padding: 44px;
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-copy .eyebrow {
  color: #cae8dc;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(2.35rem, 4.5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.08rem;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin: 18px 0;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  padding: 12px 16px;
}

.ad-slot span {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-slot strong {
  color: var(--text);
  font-size: 0.92rem;
}

body[data-access="paid"] [data-ad-slot] {
  display: none;
}

.noscript-alert {
  display: grid;
  gap: 4px;
  margin: 0 0 18px;
  border: 1px solid rgba(180, 95, 20, 0.42);
  border-radius: 8px;
  background: #fff7eb;
  color: var(--text);
  padding: 14px 16px;
}

.noscript-alert span {
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 24px;
  align-items: start;
  padding: 10px 0 36px;
}

.tool-panel,
.result-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.result-panel {
  position: sticky;
  top: 16px;
}

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

.panel-heading.compact {
  margin-top: 24px;
}

label {
  display: block;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 760;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--text);
  font: inherit;
}

input {
  padding: 0 10px;
}

select {
  padding: 0 10px;
}

input:disabled {
  background: #edf0ea;
  color: #858d86;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(180, 95, 20, 0.26);
  outline-offset: 2px;
}

.field-grid,
.rule-row,
.preset-row,
.sample-row {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sample-row {
  grid-template-columns: repeat(2, minmax(220px, 0.48fr));
}

.rule-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.7fr) minmax(210px, 1fr);
  align-items: end;
}

.preset-row {
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
  align-items: end;
  margin-top: 14px;
}

.input-unit {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-top: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
}

.input-unit input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.input-unit span {
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.check-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding-bottom: 2px;
  color: var(--muted);
  font-weight: 720;
}

.check-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.box-list {
  display: grid;
  gap: 10px;
}

.box-row {
  display: grid;
  grid-template-columns: minmax(136px, 1.25fr) repeat(3, minmax(64px, 0.55fr)) minmax(84px, 0.7fr) minmax(82px, 0.7fr) 78px;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.box-row input {
  min-height: 38px;
  margin-top: 6px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.status-line {
  display: block;
  min-height: 24px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.status-line[data-tone="success"] {
  color: var(--accent-dark);
}

.status-line[data-tone="warning"] {
  color: var(--amber);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 780;
}

.primary-button {
  flex: 1 1 180px;
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.icon-button {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
}

.secondary-button {
  flex: 0 0 auto;
  padding: 0 16px;
}

a.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.paid-feature {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.paid-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #f5eadc;
  color: var(--amber);
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 840;
  line-height: 1;
}

body[data-access="paid"] .paid-badge {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.icon-button {
  width: 78px;
  min-height: 38px;
  color: var(--danger);
  font-size: 0.82rem;
}

.result-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 820;
}

.score-badge.warning {
  background: var(--amber);
}

.score-badge.danger {
  background: var(--danger);
}

.result-hero strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.35rem;
  line-height: 1.18;
}

.result-hero p,
.details p,
.faq p,
.price-card p,
.decision-notes p {
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
  text-transform: uppercase;
}

.metric-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.04rem;
}

.decision-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.decision-insights div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.decision-insights div[data-tone="success"] {
  border-color: rgba(33, 110, 85, 0.34);
  background: #f1faf5;
}

.decision-insights div[data-tone="warning"] {
  border-color: rgba(180, 95, 20, 0.34);
  background: #fff7eb;
}

.decision-insights span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
  text-transform: uppercase;
}

.decision-insights strong {
  display: block;
  margin-top: 4px;
  font-size: 1.04rem;
}

.decision-insights p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap:focus-visible {
  outline: 3px solid rgba(180, 95, 20, 0.26);
  outline-offset: 2px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}

thead th {
  background: var(--surface-blue);
  color: #24465b;
  font-size: 0.75rem;
  font-weight: 840;
  text-transform: uppercase;
}

tbody th {
  background: #ffffff;
  font-weight: inherit;
}

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

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

td strong,
tbody th strong,
td span,
tbody th span,
td small,
tbody th small {
  display: block;
}

td span,
tbody th span,
td small,
tbody th small {
  color: var(--muted);
}

td small,
tbody th small {
  margin-top: 3px;
  font-size: 0.76rem;
}

.table-status {
  color: var(--accent-dark);
  font-weight: 820;
}

.table-status-not_viable,
.table-status-negative_margin {
  color: var(--danger);
}

.table-status-below_target {
  color: var(--amber);
}

.best-row td,
.best-row th {
  background: #f1faf5;
}

.note-stack {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.note-stack p {
  margin: 0;
  border-left: 3px solid var(--blue);
  background: #f7fbfe;
  padding: 9px 11px;
}

.formula-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.formula-details summary {
  color: var(--text);
  font-size: 0.88rem;
}

.formula-details ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 0.86rem;
}

.result-actions {
  justify-content: flex-end;
}

.copy-fallback {
  margin-top: 12px;
}

.copy-fallback textarea {
  width: 100%;
  min-height: 150px;
  margin-top: 7px;
  resize: vertical;
  padding: 10px;
}

.batch-panel {
  margin: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.batch-panel .panel-heading p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
}

.batch-panel textarea {
  width: 100%;
  min-height: 130px;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--text);
  font: inherit;
  padding: 10px;
  resize: vertical;
}

.helper-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.batch-error-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.batch-error-list[hidden] {
  display: none;
}

.batch-error-list li {
  border-left: 3px solid #b45309;
  background: #fff7ed;
  color: #7c2d12;
  padding: 8px 10px;
  font-size: 0.88rem;
  line-height: 1.35;
}

.batch-table-wrap {
  margin-top: 14px;
}

.batch-table-wrap table {
  min-width: 920px;
}

.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 34px 0;
}

.details a,
.guide-article a {
  color: var(--accent-dark);
  font-weight: 760;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.guide-hero {
  position: relative;
  display: grid;
  min-height: 300px;
  overflow: hidden;
  border-radius: 8px;
  background: #14231e;
  isolation: isolate;
}

.guide-hero img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide-hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgba(11, 24, 20, 0.84), rgba(11, 24, 20, 0.52) 58%, rgba(11, 24, 20, 0.2));
}

.guide-hero > div {
  align-self: end;
  max-width: 760px;
  padding: 42px;
  color: #ffffff;
}

.guide-hero .eyebrow {
  color: #cae8dc;
}

.guide-hero .lede {
  margin-bottom: 20px;
}

.guide-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  padding: 0 18px;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 24px;
  align-items: start;
  padding: 28px 0 48px;
}

.guide-article,
.guide-side {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.guide-article {
  display: grid;
  gap: 18px;
}

.guide-article h2,
.guide-article h3,
.guide-side h2 {
  margin-bottom: 6px;
}

.guide-article p,
.guide-side li {
  color: var(--muted);
}

.guide-callout,
.formula-card {
  border: 1px solid rgba(33, 110, 85, 0.28);
  border-radius: 8px;
  background: #f1faf5;
  padding: 16px;
}

.guide-callout p {
  margin-bottom: 0;
}

.formula-card {
  display: grid;
  gap: 6px;
}

.formula-card span {
  color: var(--muted);
  font-weight: 720;
}

.guide-steps,
.source-list,
.guide-side ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

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

.guide-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.guide-grid p {
  margin-bottom: 0;
}

.guide-side {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}

.guide-side .secondary-button {
  width: 100%;
}

.pricing {
  padding: 36px 0 10px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 18px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.price-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.price-card.emphasized {
  border-color: rgba(33, 110, 85, 0.45);
  background: #f1faf5;
}

.price-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.price-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.65rem;
  line-height: 1.1;
}

.price-features {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.38;
  list-style: none;
}

.price-features li {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.price-action {
  width: 100%;
  margin-top: 8px;
}

.price-card .primary-button,
.price-card .secondary-button {
  flex: 0 0 auto;
}

.access-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px 16px;
}

.checkout-status {
  margin-top: 14px;
}

.access-status span {
  color: var(--muted);
  font-size: 0.92rem;
}

.access-card {
  margin: 18px 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.access-detail-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.access-detail-list div {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.access-detail-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.access-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 760;
}

.faq {
  max-width: 780px;
  padding: 40px 0 54px;
}

details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 760;
}

.site-footer {
  min-height: 82px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 1020px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

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

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-side {
    position: static;
  }

  .result-panel {
    position: static;
  }

  .box-row {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .box-row label:first-child,
  .box-row .icon-button {
    grid-column: span 2;
  }
}

@media (max-width: 780px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
  }

  .site-nav,
  .site-footer nav {
    flex-wrap: wrap;
  }

  .intro-band {
    min-height: 280px;
  }

  .guide-hero {
    min-height: 280px;
  }

  .intro-band::after {
    background: linear-gradient(0deg, rgba(11, 24, 20, 0.82), rgba(11, 24, 20, 0.3));
  }

  .guide-hero::after {
    background: linear-gradient(0deg, rgba(11, 24, 20, 0.84), rgba(11, 24, 20, 0.34));
  }

  .intro-copy {
    padding: 26px;
  }

  .guide-hero > div {
    padding: 26px;
  }

  .ad-slot {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-grid.three,
  .field-grid.four,
  .rule-row,
  .preset-row,
  .sample-row,
  .details,
  .guide-grid,
  .pricing-grid,
  .metric-grid,
  .decision-insights {
    grid-template-columns: 1fr;
  }

  .tool-panel,
  .result-panel {
    padding: 16px;
  }

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

  .box-row label:first-child,
  .box-row .icon-button {
    grid-column: span 2;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .secondary-button,
  .primary-button {
    width: 100%;
  }
}
