:root {
  --accent: #4f46e5;
  --accent-600: #4338ca;
  --accent-50: #eef2ff;
  --accent-100: #e0e7ff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #ffffff;
  --tint: #f8fafc;
  --good: #059669;
  --good-50: #ecfdf5;
  --bad: #dc2626;
  --bad-50: #fef2f2;
  --warn-50: #fffbeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 24px -8px rgb(15 23 42 / 0.12);
  --shadow-lg: 0 2px 4px rgb(15 23 42 / 0.04), 0 24px 48px -16px rgb(15 23 42 / 0.18);
  --font:
    ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

img,
svg {
  display: block;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.narrow {
  max-width: 780px;
}

.center {
  text-align: center;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgb(79 70 229 / 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-600);
}

.btn-outline {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}

.btn-ghost:hover {
  background: var(--tint);
}

.btn-light {
  background: #fff;
  color: var(--accent);
}

.btn-sm {
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.link-btn {
  background: none;
  border: 0;
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}

.link-btn:hover:not(:disabled) {
  color: var(--accent);
  background: var(--accent-50);
}

.link-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---------- header / footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 255 255 / 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.logo:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
}

.nav a:hover {
  background: var(--tint);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--tint);
  padding: 56px 0 32px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-brand p {
  color: var(--muted);
  max-width: 300px;
}

.site-footer h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.site-footer ul a {
  color: var(--ink-2);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- hero ---------- */

.hero {
  padding: 56px 0 40px;
  text-align: center;
  background:
    radial-gradient(1000px 400px at 50% -120px, var(--accent-100), transparent 70%), var(--bg);
}

.hero-tight {
  padding-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--accent-100);
  color: var(--accent-600);
  font-size: 13px;
  font-weight: 600;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  max-width: 880px;
  margin: 0 auto 16px;
}

.lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-2);
  max-width: 700px;
  margin: 0 auto 32px;
}

/* ---------- tool ---------- */

.tool-wrap {
  text-align: left;
  scroll-margin-top: 88px;
}

.tool {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.tool-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 4px 12px;
}

.seg {
  display: inline-flex;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}

.seg label,
.billing-toggle label {
  position: relative;
  cursor: pointer;
}

.seg input,
.billing-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span,
.billing-toggle span {
  display: block;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.seg input:checked + span,
.billing-toggle input:checked + span {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.12);
}

.seg input:focus-visible + span,
.billing-toggle input:focus-visible + span {
  outline: 2px solid var(--accent);
}

.select select {
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tint)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  appearance: none;
  cursor: pointer;
}

.panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  min-width: 0;
}

.pane-out {
  background: var(--tint);
}

.pane-head,
.pane-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.pane-head {
  border-bottom: 1px solid var(--line);
}

.pane-foot {
  border-top: 1px solid var(--line);
  min-height: 64px;
}

.pane-tools {
  display: flex;
  gap: 2px;
}

.input,
.output {
  width: 100%;
  height: 380px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  overflow-y: auto;
}

.input {
  border: 0;
  resize: none;
  outline: none;
  background: transparent;
}

.output {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.output .placeholder {
  margin: 0;
  color: var(--muted);
}

.pane-single .input {
  height: 300px;
}

.count {
  font-weight: 500;
}

.count.over b {
  color: var(--bad);
}

.tool-meta {
  margin: 12px 4px 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.notice {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--warn-50);
  border: 1px solid #fde68a;
  color: #78350f;
}

.notice[hidden],
.scores[hidden] {
  display: none;
}

.notice.is-error {
  background: var(--bad-50);
  border-color: #fecaca;
  color: #7f1d1d;
}

.notice.is-ok {
  background: var(--good-50);
  border-color: #a7f3d0;
  color: #064e3b;
}

.loading {
  display: grid;
  gap: 10px;
}

.loading span {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 0%, #f1f5f9 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.loading span:nth-child(2) {
  width: 92%;
}

.loading span:nth-child(3) {
  width: 78%;
}

.loading span:nth-child(4) {
  width: 85%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- scores ---------- */

.scores {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.scores h3 {
  font-size: 15px;
  margin: 0 0 12px;
}

.score-table {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.score-row > b {
  font-weight: 600;
}

.score-bars {
  display: grid;
  gap: 6px;
}

.bar {
  display: grid;
  grid-template-columns: 70px 1fr 52px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--bad);
}

.bar-fill.mid {
  background: #d97706;
}

.bar-fill.low {
  background: var(--good);
}

.bar b {
  text-align: right;
  color: var(--ink);
}

.score-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- sections ---------- */

.section {
  padding: 72px 0;
}

.section-tint {
  background: var(--tint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-size: clamp(26px, 3.4vw, 36px);
  text-align: center;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 32px;
  max-width: 600px;
}

.section-title + .steps,
.section-title + .features,
.section-title + .compare,
.section-title + .quotes,
.section-title + .faq,
.section-title + .related {
  margin-top: 40px;
}

.detectors {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.detectors p {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detectors ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 40px;
}

.detectors li {
  font-size: 20px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: -0.02em;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.steps li {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.step-n {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-50);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}

.steps h3,
.feature h3 {
  font-size: 18px;
}

.steps p,
.feature p {
  margin: 0;
  color: var(--ink-2);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature {
  padding: 24px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.feature h3::before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  margin-bottom: 16px;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-card {
  margin: 0;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--tint);
}

.compare-good {
  background: #fff;
  border-color: var(--accent-100);
  box-shadow: var(--shadow);
}

.compare-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 12px;
}

.compare-card p {
  margin: 0;
  color: var(--ink-2);
}

.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.pill-bad {
  background: var(--bad-50);
  color: var(--bad);
}

.pill-good {
  background: var(--good-50);
  color: var(--good);
}

.quotes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.quote {
  margin: 0;
  padding: 24px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stars {
  color: #f59e0b;
  letter-spacing: 2px;
  font-size: 14px;
}

.quote blockquote {
  margin: 0;
  flex: 1;
  color: var(--ink-2);
}

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

.quote figcaption b {
  color: var(--ink);
}

/* ---------- prose ---------- */

.prose {
  font-size: 17px;
  color: var(--ink-2);
}

.prose h2 {
  font-size: 26px;
  color: var(--ink);
  margin-top: 40px;
}

.prose section:first-child h2 {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: var(--ink);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-100);
}

.page-title {
  font-size: clamp(30px, 4vw, 40px);
}

/* ---------- faq ---------- */

.faq {
  display: grid;
  gap: 12px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0 20px;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 28px 18px 0;
  font-weight: 600;
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 14px;
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin: 0 0 18px;
  color: var(--ink-2);
}

.related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.related-card {
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

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

/* ---------- pricing ---------- */

.pricing {
  text-align: left;
}

.billing-toggle {
  display: flex;
  width: max-content;
  margin: 0 auto 32px;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}

.billing-toggle span {
  padding: 8px 18px;
}

.billing-toggle em {
  font-style: normal;
  font-size: 12px;
  color: var(--good);
  margin-left: 4px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.plan {
  position: relative;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.plan-featured {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-lg);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 28px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.plan h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.plan-desc {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price b {
  font-size: 40px;
  letter-spacing: -0.03em;
}

.price b[hidden],
.price-note span[hidden] {
  display: none;
}

.price span {
  color: var(--muted);
}

.price-note {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
  font-size: 15px;
  color: var(--ink-2);
}

.plan-list li {
  padding-left: 26px;
  position: relative;
}

.plan-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--good);
  border-bottom: 2px solid var(--good);
  transform: rotate(-45deg);
}

.money-back {
  text-align: center;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.cta-band {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 64px 0;
}

.cta-band h2 {
  font-size: clamp(26px, 3.4vw, 34px);
}

.cta-band p {
  opacity: 0.85;
  margin: 0 0 24px;
}

/* ---------- auth / account ---------- */

.auth {
  display: grid;
  place-items: center;
  padding: 64px 24px 96px;
  background: radial-gradient(800px 300px at 50% -80px, var(--accent-100), transparent 70%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: 26px;
  margin-bottom: 4px;
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.form input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
}

.form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-100);
}

.form-aside {
  margin: -8px 0 0;
  font-size: 13px;
  color: var(--muted);
  justify-self: end;
}

.form-error,
.form-ok {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin: 16px 0 0;
}

.form-error {
  background: var(--bad-50);
  color: #7f1d1d;
}

.form-ok {
  background: var(--good-50);
  color: #064e3b;
}

.auth-switch {
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.fine {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 16px 0 0;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.card p {
  margin: 0;
  font-size: 14px;
}

.card-label {
  color: var(--muted);
  font-weight: 600;
}

.card .card-value {
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0;
  color: var(--ink);
}

.card-value .muted {
  font-size: 15px;
  font-weight: 500;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-actions form {
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    height: auto;
    row-gap: 0;
    padding-top: 10px;
  }

  .nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    margin: 0 -8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav a {
    font-size: 14px;
    white-space: nowrap;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .steps,
  .features,
  .quotes,
  .plans {
    grid-template-columns: 1fr;
  }

  .plans {
    max-width: 460px;
    margin: 0 auto;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 16px;
  }

  .hide-sm {
    display: none;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .panes,
  .compare {
    grid-template-columns: 1fr;
  }

  .tool {
    padding: 10px;
    border-radius: 14px;
  }

  .input,
  .output {
    height: 240px;
  }

  .section {
    padding: 52px 0;
  }

  .score-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .auth-card {
    padding: 24px;
  }
}
