.page-tool .page-hero {
  padding-top: var(--space-7);
  padding-bottom: var(--space-5);
}

.tp-form {
  display: grid;
  gap: 14px;
}

.tp-form input,
.tp-form select {
  width: 100%;
}

.tp-grid-2 {
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .tp-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.tp-pass-layout {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

@media (min-width: 880px) {
  .tp-pass-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    align-items: start;
  }
}

.tp-qr-card,
.tp-otp-card {
  background: #fff;
  border: 1px solid #e5e2dc;
  border-radius: 12px;
  padding: 16px;
}

.tp-qr-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #faf9f7;
  border-radius: 10px;
  overflow: hidden;
}

.tp-qr-frame svg {
  width: 200px;
  height: 200px;
  max-width: 100%;
}

.tp-qr-meta {
  margin: 12px 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
}

.tp-qr-link {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  word-break: break-all;
}

.tp-qr-link a {
  color: #1f4b7a;
}

.tp-pass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tp-otp-card h4 {
  margin: 0 0 8px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.tp-otp-code {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #1f4b7a;
  font-variant-numeric: tabular-nums;
}

.tp-pass-dl {
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.tp-pass-dl div {
  display: grid;
  gap: 2px;
}

.tp-pass-dl dt {
  font-size: 0.75rem;
  color: #5c5c5c;
}

.tp-pass-dl dd {
  margin: 0;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.tp-pass-dl code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

/* Anti-scalping flows */
.tp-flow-figure {
  margin: 32px 0 0;
}

.tp-flow-caption {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.tp-flow-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

@media (min-width: 900px) {
  .tp-flow-track {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr);
    align-items: stretch;
  }

  .tp-flow-defence .tp-flow-track {
    grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr);
  }
}

.tp-flow-node {
  background: #fff;
  border: 1px solid #e5e2dc;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.06);
}

.tp-flow-node .tp-flow-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #f7f6f3;
  color: #1f4b7a;
  font-size: 0.75rem;
  font-weight: 600;
}

.tp-flow-node strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.tp-flow-node p {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #5c5c5c;
}

.tp-flow-node code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.tp-flow-node.is-bad {
  border-color: #f0c7c7;
  background: #fffafa;
}

.tp-flow-node.is-ok {
  border-color: #c7e2d0;
  background: #f7fbf8;
}

.tp-flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
}

.tp-flow-arrow span {
  width: 12px;
  height: 12px;
  border-right: 2px solid #1f4b7a;
  border-bottom: 2px solid #1f4b7a;
  transform: rotate(45deg);
}

@media (min-width: 900px) {
  .tp-flow-arrow span {
    transform: rotate(-45deg);
  }
}

.tp-split {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

@media (min-width: 900px) {
  .tp-split {
    grid-template-columns: 1fr 1fr;
  }
}

.tp-split-card {
  background: #fff;
  border: 1px solid #e5e2dc;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.06);
}

.tp-split-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tp-diagram {
  display: block;
  width: 100%;
  height: auto;
}

.tp-npm-panel {
  margin-top: 32px;
  background: #fff;
  border: 1px solid #e5e2dc;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.06);
}

@media (min-width: 768px) {
  .tp-npm-panel {
    padding: 32px;
  }
}

.tp-npm-head h3 {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tp-npm-head p {
  margin: 0;
  color: #5c5c5c;
  line-height: 1.6;
  max-width: 62ch;
}

.tp-npm-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

@media (min-width: 880px) {
  .tp-npm-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

.tp-code-block {
  background: #faf9f7;
  border: 1px solid #e5e2dc;
  border-radius: 12px;
  padding: 16px;
}

.tp-code-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #5c5c5c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tp-code-label + pre + .tp-code-label {
  margin-top: 16px;
}

.tp-code-block pre {
  margin: 0;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #1a1a1a;
  white-space: pre;
}

.tp-npm-points {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.tp-npm-points li {
  padding: 12px 14px;
  border: 1px solid #e5e2dc;
  border-radius: 10px;
  background: #faf9f7;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #5c5c5c;
}

.tp-npm-points strong {
  color: #1a1a1a;
  font-weight: 600;
}

.tp-npm-points a {
  color: #1f4b7a;
}

.tp-npm-points code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}

.tp-stack-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.tp-stack-flow > li:not(.tp-stack-join) {
  background: #fff;
  border: 1px solid #e5e2dc;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.06);
}

.tp-stack-layer {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1f4b7a;
  letter-spacing: -0.01em;
}

.tp-stack-flow p {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #5c5c5c;
}

.tp-stack-flow code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}

.tp-stack-join {
  height: 20px;
  position: relative;
}

.tp-stack-join::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #1f4b7a;
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .tp-flow-arrow span {
    transition: none;
  }
}
