h1 {
  margin-top: 32px;
  margin-bottom: 8px;
  font-size: 2rem;
}

.lede {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 28px;
  max-width: 60ch;
}

.tool {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.color-panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.color-panel h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.color-panel__row {
  display: flex;
  gap: 14px;
}

.swatch {
  width: 64px;
  height: 64px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.color-panel__fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-panel__fields label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.color-panel__fields input[type="text"] {
  font: inherit;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
}

.swap-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  justify-self: center;
}

.swap-btn:hover { filter: brightness(1.08); }

.contrast-result {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: start;
}

.preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.preview__large {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

.preview__normal {
  font-size: 1rem;
  margin: 0;
}

.ratio {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.ratio__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.ratio__value {
  font-size: 1.4rem;
  font-weight: 700;
}

.badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  gap: 10px;
}

.badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.badge--pass { background: #e3f5e9; color: #1e8e3e; }
.badge--fail { background: #fbe6e4; color: #c0392b; }

.faq { margin-top: 48px; max-width: 70ch; }

.faq h2 { font-size: 1.3rem; margin-top: 32px; }

details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 640px) {
  .color-panels { grid-template-columns: 1fr; }
  .swap-btn { justify-self: center; }
  .contrast-result { grid-template-columns: 1fr; }
}
