.perf-tool-page {
  --perf-ink: #142536;
  --perf-muted: #52667a;
  --perf-line: #d6e0ea;
  --perf-soft: #f6f9fc;
  --perf-brand: #173755;
  --perf-accent: #f2bc19;
  --perf-green: #1d9b63;
  background: #fff;
  color: var(--perf-ink);
  font-family: inherit;
  max-width: 100%;
  min-width: 0;
}

.perf-tool-page button,
.perf-tool-page input,
.perf-tool-page select,
.perf-tool-page textarea {
  font-family: inherit;
}

.perf-tool-page [hidden] {
  display: none !important;
}

.perf-tool-page .section {
  padding-top: 24px;
  padding-bottom: 22px;
}

.perf-tool-intro {
  padding-top: 28px;
}

.perf-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 26px;
  align-items: center;
}

.perf-intro-copy {
  min-width: 0;
}

.perf-kicker {
  display: inline-block;
  color: #b37f00;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.perf-intro-copy h2 {
  margin: 0;
  color: var(--perf-brand);
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.perf-intro-copy p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--perf-muted);
  font-size: 17px;
  line-height: 1.62;
  font-weight: 650;
}

.perf-hero-actions,
.perf-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.perf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.perf-btn--primary {
  border-color: var(--perf-accent);
  background: var(--perf-accent);
  color: #102235;
}

.perf-btn--light,
.perf-btn--secondary {
  border-color: var(--perf-line);
  background: #fff;
  color: var(--perf-brand);
}

.perf-btn--green {
  border-color: var(--perf-green);
  background: var(--perf-green);
  color: #fff;
}

.perf-btn:hover,
.perf-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 55, 85, .14);
}

.perf-intro-media {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--perf-line);
  border-radius: 8px;
  background: #dfe7ed;
  box-shadow: 0 12px 30px rgba(20, 37, 54, .1);
}

.perf-intro-media img {
  display: block;
  width: 100%;
  aspect-ratio: 1.4 / 1;
  object-fit: cover;
}

.perf-intro-media figcaption {
  padding: 12px 14px;
  background: #fff;
  color: #324b62;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.perf-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 24px;
  align-items: start;
}

.perf-card {
  border: 1px solid var(--perf-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(13, 41, 68, .08);
}

.perf-form,
.perf-results {
  box-sizing: border-box;
  padding: 24px;
}

.perf-results {
  position: sticky;
  top: 16px;
}

.perf-card-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.perf-card-head h2 {
  margin: 0;
  color: var(--perf-brand);
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.perf-card-head p,
.perf-section-note {
  margin: 8px 0 0;
  color: var(--perf-muted);
  font-size: 14px;
  line-height: 1.55;
}

.perf-link-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--perf-line);
  border-radius: 7px;
  background: #fff;
  color: var(--perf-brand);
  font-weight: 900;
  cursor: pointer;
}

.perf-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid #d9e5ef;
  border-radius: 8px;
  background: var(--perf-soft);
}

.perf-presets span {
  color: var(--perf-muted);
  font-size: 13px;
  font-weight: 900;
}

.perf-presets button {
  min-height: 38px;
  border: 1px solid var(--perf-line);
  border-radius: 7px;
  background: #fff;
  color: var(--perf-brand);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.perf-presets button:hover,
.perf-presets button.is-active {
  border-color: var(--perf-green);
  background: #e7f4ef;
  color: #0b5d46;
}

.perf-alert {
  padding: 12px 14px;
  border: 1px solid #f0b6a8;
  border-radius: 8px;
  background: #fff3ef;
  color: #8d2d16;
  margin-bottom: 18px;
  font-weight: 800;
}

.perf-form-section {
  padding-top: 18px;
  border-top: 1px solid #e5ebf1;
  margin-top: 18px;
}

.perf-form-section h3,
.perf-advanced summary {
  margin: 0;
  color: #183247;
  font-size: 17px;
  font-weight: 900;
}

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

.perf-field-wide {
  grid-column: 1 / -1;
}

.perf-field-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.perf-field-grid span {
  color: #263c50;
  font-size: 13px;
  font-weight: 900;
}

.perf-field-grid em {
  color: #6f8092;
  font-style: normal;
  font-weight: 800;
}

.perf-field-grid input,
.perf-field-grid select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd7e2;
  border-radius: 7px;
  background: #fff;
  color: var(--perf-ink);
  padding: 0 12px;
  font-size: 15px;
}

.perf-field-grid input:focus,
.perf-field-grid select:focus,
.perf-summary-card textarea:focus {
  outline: 3px solid rgba(29, 128, 100, .18);
  border-color: #1d8064;
}

.perf-advanced {
  margin-top: 18px;
  border-top: 1px solid #e5ebf1;
  padding-top: 18px;
}

.perf-advanced summary {
  cursor: pointer;
}

.perf-calc-btn {
  width: 100%;
  margin-top: 22px;
}

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

.perf-result-item {
  min-height: 96px;
  border: 1px solid var(--perf-line);
  border-radius: 8px;
  background: var(--perf-soft);
  padding: 14px;
}

.perf-result-item span {
  display: block;
  color: #5d7082;
  font-size: 13px;
  font-weight: 900;
}

.perf-result-item strong {
  display: block;
  margin-top: 10px;
  color: #102235;
  font-size: 22px;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.perf-warning {
  margin-top: 14px;
  border-left: 4px solid var(--perf-accent);
  background: #fff8dd;
  color: #5f4c0b;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 800;
}

.perf-pattern-preview {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  border: 1px solid var(--perf-line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.perf-pattern-preview__art {
  height: 98px;
  border: 1px solid #cdd8e2;
  border-radius: 7px;
  background-color: #d7e0e6;
  background-size: 24px 24px;
}

.perf-pattern-preview__art.is-round {
  background-image: radial-gradient(circle at 12px 12px, #24394c 0 4px, transparent 4.5px);
}

.perf-pattern-preview__art.is-square {
  background-image:
    linear-gradient(90deg, transparent 0 9px, #263a4d 9px 15px, transparent 15px 24px),
    linear-gradient(0deg, transparent 0 9px, #263a4d 9px 15px, transparent 15px 24px);
}

.perf-pattern-preview__art.is-slot {
  background-image: repeating-linear-gradient(90deg, transparent 0 7px, #263a4d 7px 18px, transparent 18px 30px);
}

.perf-pattern-preview h3 {
  margin: 0;
  color: #172d42;
  font-size: 16px;
}

.perf-pattern-preview p {
  margin: 6px 0 0;
  color: #5b6d80;
  font-size: 13px;
  line-height: 1.45;
}

.perf-pattern-preview .perf-style-reference {
  color: #17664e;
  font-weight: 900;
}

.perf-assumptions {
  margin-top: 16px;
}

.perf-assumptions h3 {
  margin: 0 0 10px;
  color: #1b3448;
  font-size: 17px;
}

.perf-assumptions dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.perf-assumptions div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e7edf3;
  padding-bottom: 8px;
}

.perf-assumptions dt {
  color: #65778a;
  font-weight: 800;
}

.perf-assumptions dd {
  margin: 0;
  color: var(--perf-ink);
  font-weight: 900;
  text-align: right;
}

.perf-summary-card {
  margin-top: 16px;
}

.perf-summary-card label {
  display: block;
  color: #1d344b;
  font-weight: 900;
  margin-bottom: 8px;
}

.perf-summary-card textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 1px solid #cbd7e2;
  border-radius: 8px;
  color: var(--perf-ink);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
}

.perf-copy-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: #0b6a50;
  font-weight: 900;
}

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

.perf-support-grid article,
.perf-faq details {
  border: 1px solid var(--perf-line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.perf-support-grid h2,
.perf-faq h2 {
  margin: 0 0 10px;
  color: #183247;
  font-size: 22px;
}

.perf-support-grid p,
.perf-faq p {
  margin: 0;
  color: #4c6072;
  line-height: 1.62;
}

.perf-link-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.perf-link-list a {
  color: #0f5f91;
  font-weight: 900;
  text-decoration: none;
}

.perf-faq summary {
  color: #183247;
  font-weight: 900;
  cursor: pointer;
}

.perf-faq p {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .perf-intro-grid,
  .perf-tool-grid {
    grid-template-columns: 1fr;
  }

  .perf-results {
    position: static;
  }

  .perf-support-grid,
  .perf-faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .perf-intro-copy h2 {
    font-size: 30px;
  }

  .perf-form,
  .perf-results {
    padding: 18px;
  }

  .perf-card-head {
    display: grid;
  }

  .perf-field-grid,
  .perf-result-grid,
  .perf-pattern-preview {
    grid-template-columns: 1fr;
  }

  .perf-result-actions .perf-btn,
  .perf-hero-actions .perf-btn {
    width: 100%;
  }

  .perf-assumptions div {
    display: grid;
  }

  .perf-assumptions dd {
    text-align: left;
  }
}
