.rh-tool,
.rh-library,
.rh-contact-form {
  --rh-tool-ink: #16161f;
  --rh-tool-muted: #646477;
  --rh-tool-line: #dedbea;
  --rh-tool-wash: #f6f5fb;
  --rh-tool-violet: #6842e8;
  --rh-tool-violet-dark: #4b28bd;
  --rh-tool-coral: #c83249;
  --rh-tool-mint: #147c64;
  color: var(--rh-tool-ink);
}

[hidden] {
  display: none !important;
}

.rh-tool {
  max-width: 1080px !important;
  margin: 2rem auto 3rem !important;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--rh-tool-line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(41, 28, 91, 0.12);
}

.rh-tool-head {
  display: flex;
  padding: clamp(1.35rem, 4vw, 2.5rem);
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(145deg, #faf9ff, #f5f2ff);
  border-bottom: 1px solid var(--rh-tool-line);
}

.rh-tool-head h2,
.rh-results h3,
.rh-rewrite-box h3,
.rh-script-plan h3 {
  margin: 0.15rem 0 0.55rem;
  color: var(--rh-tool-ink);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.rh-tool-head h2 {
  font-size: clamp(1.65rem, 4vw, 2.5rem);
}

.rh-tool-head p,
.rh-results-head p {
  max-width: 680px;
  margin: 0;
  color: var(--rh-tool-muted);
}

.rh-kicker {
  margin: 0 !important;
  color: var(--rh-tool-violet-dark) !important;
  font-size: 0.76rem !important;
  font-weight: 850 !important;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.rh-local-badge {
  display: inline-flex;
  flex: none;
  padding: 0.55rem 0.75rem;
  align-items: center;
  gap: 0.35rem;
  color: #0c614d;
  background: #eafaf4;
  border: 1px solid #bdebdc;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.rh-form,
.rh-contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.rh-form {
  padding: clamp(1.35rem, 4vw, 2.5rem);
}

.rh-contact-form {
  max-width: 760px;
  margin: 2rem auto;
  padding: clamp(1.2rem, 4vw, 2rem);
  background: #fff;
  border: 1px solid var(--rh-tool-line);
  border-radius: 18px;
}

.rh-field {
  min-width: 0;
}

.rh-field--wide,
.rh-contact-form .rh-field:nth-of-type(4),
.rh-contact-form .rh-checkbox,
.rh-contact-form > button,
.rh-contact-form > .rh-field-help {
  grid-column: 1 / -1;
}

.rh-field label,
.rh-library-controls label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--rh-tool-ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.rh-field input,
.rh-field select,
.rh-field textarea,
.rh-library-controls select {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.72rem 0.85rem;
  color: var(--rh-tool-ink);
  background: #fff;
  border: 1px solid #c9c5d8;
  border-radius: 11px;
  box-shadow: none;
}

.rh-field textarea {
  min-height: 92px;
  resize: vertical;
}

.rh-field input:focus,
.rh-field select:focus,
.rh-field textarea:focus,
.rh-library-controls select:focus {
  outline: 3px solid rgba(104, 66, 232, 0.18);
  outline-offset: 1px;
  border-color: var(--rh-tool-violet);
}

.rh-field-help {
  display: block;
  margin-top: 0.35rem;
  color: var(--rh-tool-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.rh-form-actions {
  display: flex;
  padding-top: 0.25rem;
  align-items: center;
  gap: 0.75rem;
}

.rh-primary-button,
.rh-secondary-button,
.rh-text-button {
  display: inline-flex;
  min-height: 44px;
  padding: 0.72rem 1rem;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.rh-primary-button {
  color: #fff;
  background: var(--rh-tool-violet);
  border: 1px solid var(--rh-tool-violet);
}

.rh-primary-button:hover {
  color: #fff;
  background: var(--rh-tool-violet-dark);
  border-color: var(--rh-tool-violet-dark);
}

.rh-secondary-button {
  color: var(--rh-tool-violet-dark);
  background: #fff;
  border: 1px solid #bdb6d9;
}

.rh-secondary-button:hover {
  background: #f4f1ff;
}

.rh-text-button {
  min-height: 36px;
  padding: 0.4rem 0.7rem;
  color: var(--rh-tool-violet-dark);
  background: transparent;
  border: 1px solid #cfc9e6;
}

.rh-primary-button:focus-visible,
.rh-secondary-button:focus-visible,
.rh-text-button:focus-visible {
  outline: 3px solid rgba(104, 66, 232, 0.3);
  outline-offset: 2px;
}

.rh-form-error {
  margin: 0;
  padding: 0.75rem 0.9rem;
  color: #7a1724;
  background: #fff1f3;
  border: 1px solid #f1b7bf;
  border-radius: 10px;
  font-size: 0.9rem;
}

.rh-results {
  padding: clamp(1.35rem, 4vw, 2.5rem);
  background: #fbfaff;
  border-top: 1px solid var(--rh-tool-line);
}

.rh-results-head,
.rh-script-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rh-hook-grid,
.rh-check-grid,
.rh-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.rh-hook-grid,
.rh-check-grid {
  margin-top: 1.25rem;
}

.rh-hook-card,
.rh-check-card,
.rh-library-card {
  position: relative;
  padding: 1rem;
  background: #fff;
  border: 1px solid var(--rh-tool-line);
  border-radius: 15px;
}

.rh-hook-card-top {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.rh-hook-type,
.rh-score-pill,
.rh-card-tags span {
  display: inline-flex;
  padding: 0.25rem 0.48rem;
  align-items: center;
  color: #4f4670;
  background: #f1eefb;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rh-score-pill {
  color: #0c614d;
  background: #eafaf4;
}

.rh-hook-text,
.rh-library-card > p {
  margin: 0 0 0.75rem !important;
  color: var(--rh-tool-ink);
  font-size: 1.03rem;
  font-weight: 750;
  line-height: 1.45;
}

.rh-hook-reason {
  min-height: 2.8em;
  margin: 0 0 0.9rem !important;
  color: var(--rh-tool-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.rh-script-plan,
.rh-rewrite-box {
  margin-top: 1.25rem;
  padding: 1.15rem;
  background: #fff;
  border: 1px solid var(--rh-tool-line);
  border-radius: 15px;
}

.rh-script-plan ol {
  display: grid;
  margin: 1rem 0 0;
  padding: 0;
  gap: 0.65rem;
  list-style: none;
  counter-reset: rh-plan;
}

.rh-script-plan li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  color: #302e3e;
  counter-increment: rh-plan;
}

.rh-script-plan li::before {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--rh-tool-violet);
  border-radius: 9px;
  content: counter(rh-plan);
  font-size: 0.78rem;
  font-weight: 850;
}

.rh-tool-disclaimer {
  margin: 1.2rem 0 0 !important;
  padding-top: 1rem;
  color: var(--rh-tool-muted);
  border-top: 1px solid var(--rh-tool-line);
  font-size: 0.78rem;
  line-height: 1.5;
}

.rh-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.rh-analysis-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  margin-bottom: 1.25rem;
  gap: 1rem;
  align-items: center;
}

.rh-analysis-summary p {
  margin: 0;
  color: var(--rh-tool-muted);
}

.rh-score-ring {
  display: grid;
  width: 96px;
  height: 96px;
  place-content: center;
  text-align: center;
  background: #fff;
  border: 9px solid var(--rh-tool-violet);
  border-radius: 50%;
}

.rh-score-ring strong {
  font-size: 1.55rem;
  line-height: 1;
}

.rh-score-ring span {
  color: var(--rh-tool-muted);
  font-size: 0.72rem;
}

.rh-check-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
}

.rh-check-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: var(--rh-tool-mint);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 900;
}

.rh-check-card.is-warning .rh-check-icon {
  background: #9a4b00;
}

.rh-check-card h4 {
  margin: 0 0 0.2rem;
  font-size: 0.94rem;
}

.rh-check-card p {
  margin: 0;
  color: var(--rh-tool-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.rh-rewrite-item {
  display: flex;
  padding: 0.7rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--rh-tool-line);
}

.rh-rewrite-item:last-child {
  border-bottom: 0;
}

.rh-rewrite-item p {
  margin: 0 !important;
  color: var(--rh-tool-ink);
}

.rh-library {
  max-width: 1080px !important;
  margin: 2rem auto 3rem !important;
}

.rh-library-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
  padding: 1rem;
  gap: 1rem;
  background: var(--rh-tool-wash);
  border: 1px solid var(--rh-tool-line);
  border-radius: 15px;
}

.rh-card-tags {
  display: flex;
  margin-bottom: 0.7rem;
  gap: 0.35rem;
}

.rh-library-card[hidden] {
  display: none;
}

.rh-empty-filter {
  padding: 1rem;
  text-align: center;
  background: var(--rh-tool-wash);
  border-radius: 12px;
}

.rh-checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  color: var(--rh-tool-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.rh-checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 0.15rem;
}

.rh-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.rh-notice {
  max-width: 760px;
  margin: 1rem auto;
  padding: 0.85rem 1rem;
  border-radius: 11px;
}

.rh-notice--success {
  color: #0c614d;
  background: #eafaf4;
  border: 1px solid #bdebdc;
}

.rh-notice--error {
  color: #7a1724;
  background: #fff1f3;
  border: 1px solid #f1b7bf;
}

@media (max-width: 720px) {
  .rh-tool-head,
  .rh-results-head,
  .rh-script-plan-head {
    align-items: stretch;
    flex-direction: column;
  }

  .rh-form,
  .rh-contact-form,
  .rh-hook-grid,
  .rh-check-grid,
  .rh-library-grid,
  .rh-library-controls {
    grid-template-columns: 1fr;
  }

  .rh-field--wide,
  .rh-contact-form .rh-field:nth-of-type(4),
  .rh-contact-form .rh-checkbox,
  .rh-contact-form > button,
  .rh-contact-form > .rh-field-help {
    grid-column: auto;
  }

  .rh-local-badge {
    align-self: flex-start;
  }

  .rh-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .rh-analysis-summary {
    grid-template-columns: 1fr;
  }

  .rh-score-ring {
    width: 86px;
    height: 86px;
  }

  .rh-rewrite-item {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rh-tool *,
  .rh-library * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
