:root {
  --ink: #172033;
  --muted: #657187;
  --line: #dce4ee;
  --paper: #ffffff;
  --soft: #f5f8fb;
  --panel: #eef4fb;
  --blue: #2563eb;
  --green: #0f9f6e;
  --red: #d64242;
  --gold: #b7791f;
  --violet: #6d3bd1;
  --cyan: #0891b2;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

img {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(220, 228, 238, 0.85);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  min-height: 66px;
  margin: 0 auto;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-size: 15px;
}

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

.nav-links a {
  border-radius: 8px;
  color: #324158;
  font-size: 14px;
  font-weight: 650;
  padding: 8px 10px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--blue);
  background: #edf4ff;
  text-decoration: none;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 560px;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: #fff;
  background: #14202f;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(90deg, rgba(8, 19, 31, 0.93) 0%, rgba(8, 19, 31, 0.78) 38%, rgba(8, 19, 31, 0.26) 72%), var(--hero-image);
  background-size: cover;
  background-position: center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 130px;
  z-index: -1;
  background: linear-gradient(0deg, #f7fafc, rgba(247, 250, 252, 0));
}

.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 86px 0 118px;
}

.hero-copy {
  width: min(690px, 100%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #bfe8ff;
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.18);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(42px, 6vw, 76px);
}

h2 {
  font-size: clamp(26px, 3vw, 40px);
}

h3 {
  font-size: 20px;
}

p {
  margin: 0;
}

.hero p {
  max-width: 620px;
  margin-top: 20px;
  color: #d7e3f1;
  font-size: 19px;
}

.hero-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  color: #fff;
  background: var(--blue);
  font-weight: 750;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
  background: #1d4ed8;
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.button.secondary:hover {
  background: #f1f6fc;
}

.button.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.10);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0;
}

.section.tight {
  padding-top: 30px;
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: 760px;
  margin-bottom: 26px;
}

.section-head p {
  color: var(--muted);
  font-size: 17px;
}

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

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 30px rgba(23, 32, 51, 0.05);
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.card p,
.content p,
.content li,
.note {
  color: var(--muted);
}

.label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #174e41;
  background: #dff8ed;
  font-size: 13px;
  font-weight: 750;
}

.label.warn {
  color: #6d3f00;
  background: #fff2cf;
}

.label.blue {
  color: #17407d;
  background: #e5efff;
}

.page-hero {
  background: #f2f7fb;
  border-bottom: 1px solid var(--line);
}

.page-hero .section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 36px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}

.page-hero h1 {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 56px);
}

.page-hero p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
}

.quick-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 18px;
}

.quick-panel dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  margin: 0;
}

.quick-panel dt {
  color: var(--muted);
}

.quick-panel dd {
  margin: 0;
  font-weight: 750;
}

.codes-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.codes-table th {
  color: #34445c;
  background: #edf4fb;
  font-size: 13px;
  text-transform: uppercase;
}

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

code,
.code-pill {
  border-radius: 7px;
  color: #0f172a;
  background: #edf2f7;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  font-weight: 750;
}

code {
  padding: 2px 5px;
}

.code-pill {
  display: inline-flex;
  padding: 7px 9px;
}

.copy-btn {
  min-width: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  font-weight: 750;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: #b9c8d9;
  background: #f5f8fb;
}

.tool {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.tool-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #bac8d8;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.15);
  border-color: var(--blue);
}

.result {
  border-radius: 8px;
  padding: 15px;
  background: #eef6ff;
  color: #16345c;
  font-weight: 700;
}

.result.good {
  background: #e1f8ed;
  color: #0f5137;
}

.result.bad {
  background: #fdeaea;
  color: #8a2525;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.steps li {
  position: relative;
  min-height: 54px;
  padding: 14px 16px 14px 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.content {
  display: grid;
  gap: 20px;
}

.content ul {
  margin: 0;
  padding-left: 22px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.toc a {
  color: #40516a;
  font-weight: 650;
}

.source-list {
  display: grid;
  gap: 8px;
}

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: #101827;
  color: #d7e3f1;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
}

.footer a {
  color: #c7ddff;
}

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

.rank-list {
  display: grid;
  gap: 12px;
}

.rank-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.rank {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--violet);
  font-weight: 850;
}

.small {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

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

  .hero {
    min-height: 620px;
  }

  .hero::before {
    background-image: linear-gradient(180deg, rgba(8, 19, 31, 0.94) 0%, rgba(8, 19, 31, 0.77) 48%, rgba(8, 19, 31, 0.22) 100%), var(--hero-image);
    background-position: center right;
  }

  .page-hero .section,
  .grid,
  .grid.two,
  .split,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .section,
  .nav,
  .hero-inner,
  .footer-inner {
    width: min(100% - 24px, 1180px);
  }

  .codes-table,
  .codes-table thead,
  .codes-table tbody,
  .codes-table th,
  .codes-table td,
  .codes-table tr {
    display: block;
  }

  .codes-table thead {
    display: none;
  }

  .codes-table tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }

  .codes-table td {
    border: 0;
    padding: 8px 12px;
  }

  .codes-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
  }

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

  .rank-item {
    grid-template-columns: 42px 1fr;
  }

  .rank-item .label {
    grid-column: 2;
  }
}
