:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #eef2f6;
  --ink: #172033;
  --muted: #5d687a;
  --line: #d7dde7;
  --line-strong: #b9c2d0;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #b42318;
  --green: #067647;
  --shadow: 0 12px 30px rgba(20, 31, 49, 0.08);
  --radius: 8px;
  --radius-small: 6px;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.nav {
  width: min(100% - 32px, var(--max));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-small);
  color: #ffffff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-small);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button:hover,
button:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.button.primary,
button.primary {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

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

.button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.9rem;
}

.page-shell {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.hero-band {
  padding: 42px 0 30px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.hero-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 34px;
  align-items: start;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  max-width: 850px;
  font-size: 2.45rem;
}

h2 {
  font-size: 1.55rem;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0;
}

.lead {
  margin-top: 14px;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.section {
  padding: 34px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.section-header p {
  max-width: 660px;
  color: var(--muted);
}

.tool-finder {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.tool-finder h2 {
  font-size: 1.2rem;
}

.finder-list,
.card-grid,
.trust-grid,
.result-grid {
  display: grid;
  gap: 12px;
}

.finder-list {
  margin-top: 14px;
}

.finder-option,
.calculator-card,
.trust-item,
.result-card,
.info-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.finder-option {
  display: block;
  padding: 13px;
  color: var(--ink);
}

.finder-option strong {
  display: block;
}

.finder-option span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.calculator-card,
.info-card {
  padding: 18px;
}

.calculator-card p,
.info-card p,
.trust-item p {
  margin-top: 8px;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 0.82rem;
  font-weight: 700;
}

.trust-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.trust-grid {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 16px 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.trust-item {
  min-height: 86px;
  padding: 12px;
}

.trust-item strong {
  display: block;
  font-size: 0.94rem;
}

.trust-item p {
  font-size: 0.86rem;
}

.breadcrumb {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.calculator-intro {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.mini-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.82fr);
  gap: 20px;
  align-items: start;
}

.input-panel,
.results-panel,
.content-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.content-panel {
  padding: 18px;
}

.results-panel {
  position: sticky;
  top: 88px;
  overflow: hidden;
}

.panel-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

.results-body {
  padding: 18px;
}

.form-section {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.form-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.form-section h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
}

.help {
  color: var(--muted);
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: var(--radius-small);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: #ffffff;
}

label input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-right: 8px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.status-loss {
  color: var(--red);
  background: #fff1f0;
}

.status-thin {
  color: var(--amber);
  background: #fff8e5;
}

.status-good {
  color: var(--green);
  background: #ecfdf3;
}

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

.result-card {
  min-height: 108px;
  padding: 14px;
}

.result-card .label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.result-card .value {
  margin-top: 8px;
  font-size: 1.48rem;
  font-weight: 850;
  line-height: 1.1;
}

.result-card .sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.warning-list,
.error-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.warning,
.error {
  padding: 10px 12px;
  border-radius: var(--radius-small);
  font-size: 0.92rem;
}

.warning {
  border: 1px solid #f6d58a;
  color: #6f4a00;
  background: #fff8e5;
}

.error {
  border: 1px solid #f4b3ad;
  color: var(--red);
  background: #fff1f0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

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

th {
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 0.84rem;
  text-transform: uppercase;
}

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

.details-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

summary {
  cursor: pointer;
  padding: 13px 14px;
  font-weight: 800;
}

details > div {
  padding: 0 14px 14px;
  color: var(--muted);
}

.copy-box {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 0.28fr);
  gap: 20px;
}

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

.article h2 {
  margin-top: 12px;
}

.article ul,
.article ol {
  margin: 0;
  padding-left: 22px;
}

.article li + li {
  margin-top: 8px;
}

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

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  width: min(100% - 32px, var(--max));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.sr-only {
  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: 980px) {
  .hero-inner,
  .workspace,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

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

@media (max-width: 700px) {
  .nav {
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  h1 {
    font-size: 2rem;
  }

  .field-grid,
  .card-grid,
  .trust-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    display: grid;
  }
}
