@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@500;600&family=Fira+Sans:wght@400;500;600;700&display=swap");

:root {
  --color-primary: #15803d;
  --color-on-primary: #ffffff;
  --color-secondary: #22c55e;
  --color-accent: #0369a1;
  --color-background: #f0fdf4;
  --color-foreground: #14532d;
  --color-card: #ffffff;
  --color-muted: #e8f0f1;
  --color-muted-foreground: #475569;
  --color-border: #bbf7d0;
  --color-destructive: #dc2626;
  --color-destructive-bg: #fee2e2;
  --color-on-destructive: #7f1d1d;
  --font-sans: "Fira Sans", "Segoe UI", sans-serif;
  --font-mono: "Fira Code", ui-monospace, monospace;
  --radius: 12px;
  --space: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  background: var(--color-card);
  color: var(--color-foreground);
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.top {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
}

.brand__mark { color: var(--color-primary); display: flex; }

.top__note {
  margin: 0;
  color: var(--color-muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

main { padding: 32px 0 16px; }

.kicker {
  margin: 0 0 8px;
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--color-muted-foreground);
  font-size: 1.0625rem;
}

.layout {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.panel,
.card,
.empty-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.panel { padding: 16px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.tab,
.button,
.chip {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  min-height: 44px;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tab {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-foreground);
  font-weight: 600;
}

.tab[aria-selected="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.tab:hover:not([aria-selected="true"]) { background: var(--color-muted); }

label,
.field-label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
}

.field-label { margin-top: 20px; }

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: var(--color-card);
  color: var(--color-foreground);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}

textarea,
input { padding: 12px; }

textarea { min-height: 148px; resize: vertical; }

select { min-height: 44px; padding: 0 12px; }

.help,
.status,
.footer,
.meta,
.pages,
.empty-card p,
.notice {
  color: var(--color-muted-foreground);
}

.help,
.form-error { margin: 8px 0 0; }

.form-error {
  min-height: 1.5em;
  color: var(--color-destructive);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  text-decoration: none;
}

.button--primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
  flex: 1 1 180px;
}

.button--primary:hover { background: #166534; }

.button--quiet {
  background: var(--color-card);
  color: var(--color-foreground);
  border-color: #86efac;
  font-weight: 600;
}

.button--quiet:hover { background: var(--color-muted); }

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button__icon { display: flex; }

.button__icon:empty { display: none; }

.results__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

h2 { margin: 0; font-size: 1.375rem; letter-spacing: -0.02em; }

.status { margin: 4px 0 0; }

.results__tools { display: flex; gap: 8px; flex-wrap: wrap; }

.progress {
  height: 4px;
  margin-top: 16px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 100%;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms ease;
}

.notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--color-muted);
  border-radius: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  border: 1px solid #86efac;
  background: var(--color-card);
  color: var(--color-foreground);
  padding: 0 14px;
  font-weight: 600;
}

.chip[aria-pressed="true"] {
  background: var(--color-foreground);
  border-color: var(--color-foreground);
  color: var(--color-card);
}

.result-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.card { padding: 20px; }

.card--pending { background: var(--color-muted); }

.card__top,
.email,
.card__links {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.card__top > :first-child,
.email > :first-child {
  min-width: 0;
  flex: 1;
}

.card__top { align-items: flex-start; }

.card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.domain,
.email a,
.pending-url {
  overflow-wrap: anywhere;
}

.domain {
  margin: 4px 0 0;
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
}

.domain:hover { text-decoration: underline; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--yes { background: var(--color-primary); color: var(--color-on-primary); }
.badge--no { background: var(--color-muted); color: var(--color-foreground); }
.badge--bad { background: var(--color-destructive-bg); color: var(--color-on-destructive); }
.badge--note { background: #e0f2fe; color: #0c4a6e; }

.description,
.meta,
.pages,
.error-text { margin: 12px 0 0; }

.description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.email {
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.email a {
  color: var(--color-foreground);
  font-weight: 600;
  text-decoration: none;
}

.email a:hover { text-decoration: underline; }

.email__source {
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
}

.email .button { flex: 0 0 auto; }

details { margin-top: 12px; }

summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.signals {
  margin: 0;
  padding-left: 18px;
  color: var(--color-muted-foreground);
}

.empty-card { padding: 24px; }
.empty-card__title { margin: 0 0 4px; color: var(--color-foreground); font-weight: 700; }
.empty { margin: 16px 0 0; }

.footer {
  padding: 8px 0 40px;
  font-size: 0.875rem;
  max-width: 78ch;
}

.guide {
  display: grid;
  gap: 40px;
  margin-top: 56px;
}

.guide h2 { margin-bottom: 8px; }

.guide h3 { margin: 0 0 4px; font-size: 1.0625rem; }

.guide p {
  margin: 0;
  max-width: 70ch;
  color: var(--color-muted-foreground);
}

.steps {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 20px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

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

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .faq { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
}

.dialog {
  width: min(440px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card);
  color: var(--color-foreground);
}

.dialog::backdrop { background: rgb(20 83 45 / 0.45); }

.dialog h2 { margin-bottom: 8px; }

.admin { padding: 32px 0 48px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 380px minmax(0, 1fr);
    align-items: start;
  }

  .panel {
    position: sticky;
    top: 16px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.card { animation: rise 400ms cubic-bezier(0.34, 1.4, 0.64, 1) both; }
