:root {
  --bg: #f6f7f3;
  --surface: #ffffff;
  --ink: #1d2522;
  --muted: #5b6762;
  --line: #d8ded7;
  --green: #1f8a5f;
  --green-soft: #dff3e9;
  --amber: #b87500;
  --amber-soft: #fff0cf;
  --red: #b22a2a;
  --red-soft: #ffe0df;
  --blue: #286f9e;
  --blue-soft: #dfeff8;
  --shadow: 0 18px 60px rgba(24, 34, 30, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(31, 138, 95, 0.12), transparent 42%),
    linear-gradient(300deg, rgba(40, 111, 158, 0.12), transparent 38%),
    var(--bg);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.scan-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 32px;
  align-items: end;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 7vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.scan-form {
  display: grid;
  gap: 10px;
}

.scan-tools {
  display: grid;
  gap: 18px;
}

.scan-form label {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.input-row:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 138, 95, 0.14);
}

.input-row input {
  min-width: 0;
  border: 0;
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  outline: 0;
}

.input-row button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 148px;
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.input-row button:hover {
  background: #176e4b;
}

.input-row button:disabled {
  background: #8ca89a;
  cursor: wait;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-message.error {
  color: var(--red);
}

.history-panel {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.history-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.history-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--green);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.text-button:disabled {
  color: #98a39e;
  cursor: default;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  cursor: pointer;
}

.history-list button:hover {
  border-color: rgba(31, 138, 95, 0.5);
}

.history-list span {
  color: var(--muted);
  font-size: 0.86rem;
}

.report {
  margin-top: 24px;
}

.ad-shell {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 10px;
  border: 1px solid rgba(91, 103, 98, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.ad-shell[hidden] {
  display: none;
}

.ad-shell > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ad-slot,
.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
  overflow: hidden;
}

.ad-shell-report .ad-slot,
.ad-shell-report .adsbygoogle {
  min-height: 120px;
}

.empty-state,
.summary,
.measurement-panel,
.crawl-panel,
.pagespeed-panel,
.repair-plan,
.copy-panel,
.check-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.empty-state {
  padding: 28px;
  color: var(--muted);
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--ink);
}

.summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 24px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 116px;
  aspect-ratio: 1;
  border: 10px solid var(--green);
  border-radius: 50%;
  background: var(--green-soft);
  font-size: 2rem;
  font-weight: 900;
}

.summary h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.summary p {
  margin-bottom: 14px;
  color: var(--muted);
}

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

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--green);
}

.measurement-panel,
.crawl-panel,
.pagespeed-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 20px;
}

.measurement-panel h2,
.crawl-panel h2,
.pagespeed-panel h2 {
  margin: 0;
  font-size: 1.18rem;
}

.measurement-panel p,
.crawl-panel p,
.pagespeed-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.crawl-list,
.score-grid,
.pagespeed-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crawl-list span,
.score-grid span,
.pagespeed-metrics span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.crawl-warning {
  color: var(--amber) !important;
  font-weight: 800;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.metric {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

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

.check-card {
  padding: 20px;
}

.repair-plan {
  margin-top: 16px;
  padding: 22px;
}

.copy-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 18px;
}

.copy-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.copy-panel textarea {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fbfcfa;
  font: 0.92rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.repair-plan h2 {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

.repair-plan ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: repairs;
}

.repair-plan li {
  display: grid;
  gap: 7px;
  min-height: 144px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  counter-increment: repairs;
}

.repair-plan li::before {
  content: counter(repairs);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.repair-plan li[data-status="critical"]::before {
  background: var(--red);
}

.repair-plan li[data-status="warning"]::before {
  background: var(--amber);
}

.repair-plan span,
.repair-plan small {
  color: var(--muted);
  line-height: 1.4;
}

.check-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.check-heading h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.status-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
}

.check-card[data-status="critical"] .status-dot {
  background: var(--red);
}

.check-card[data-status="warning"] .status-dot {
  background: var(--amber);
}

.check-card[data-status="notice"] .status-dot {
  background: var(--blue);
}

.check-card[data-status="critical"] {
  border-color: rgba(178, 42, 42, 0.35);
  background: linear-gradient(180deg, var(--red-soft), #fff 76%);
}

.check-card[data-status="warning"] {
  border-color: rgba(184, 117, 0, 0.35);
  background: linear-gradient(180deg, var(--amber-soft), #fff 76%);
}

.check-card[data-status="notice"] {
  border-color: rgba(40, 111, 158, 0.3);
  background: linear-gradient(180deg, var(--blue-soft), #fff 76%);
}

.findings {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.45;
}

.recommendations {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

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

.check-meta {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.examples {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

.example-link {
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a,
.back-link {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.back-link:hover {
  text-decoration: underline;
}

.legal-page {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.6;
}

.legal-page h1 {
  margin-top: 24px;
  color: var(--ink);
  font-size: clamp(2.2rem, 6vw, 4.4rem);
}

.legal-page section {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.legal-page h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.2rem;
}

.legal-page p:last-child {
  margin-bottom: 0;
}

.legal-value {
  white-space: pre-line;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding-top: 20px;
  }

  .scan-panel,
  .summary,
  .checks-grid,
  .repair-plan ol {
    grid-template-columns: 1fr;
  }

  .scan-panel {
    padding: 22px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row button {
    justify-content: center;
    min-height: 50px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .score-ring {
    width: 96px;
  }

  .ad-slot,
  .adsbygoogle {
    min-height: 100px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .scan-panel,
  .summary-actions,
  .history-panel,
  .ad-shell {
    display: none;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .report {
    margin-top: 0;
  }

  .summary,
  .measurement-panel,
  .crawl-panel,
  .pagespeed-panel,
  .repair-plan,
  .copy-panel,
  .check-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
