:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1b1a17;
  --muted: #6b6a66;
  --border: #e3e1db;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --error: #9a2f2f;
  --first-party: #2f5d50;
  --third-party: #9a5b1f;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15140f;
    --surface: #201f1a;
    --ink: #f1efe9;
    --muted: #a7a49c;
    --border: #39372f;
    --accent: #6fbfa4;
    --accent-ink: #0d1a16;
    --error: #e09a9a;
    --first-party: #6fbfa4;
    --third-party: #e0a964;
  }
}
:root[data-theme="dark"] {
  --bg: #15140f;
  --surface: #201f1a;
  --ink: #f1efe9;
  --muted: #a7a49c;
  --border: #39372f;
  --accent: #6fbfa4;
  --accent-ink: #0d1a16;
  --error: #e09a9a;
  --first-party: #6fbfa4;
  --third-party: #e0a964;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  line-height: 1.5;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.site-header {
  text-align: center;
  margin-bottom: 28px;
}

.wordmark {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 6px;
}

.tagline {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

.check-form { margin-bottom: 8px; }

.input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#url-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}

#url-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

#check-button {
  min-height: 48px;
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

#check-button:active { transform: translateY(1px); }
#check-button:disabled { opacity: 0.6; cursor: wait; }

.field-error {
  color: var(--error);
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.status-line {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 12px 0;
}

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

.report {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.report-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

#score-number {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.score-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.summary-text p { margin: 0 0 6px; }
.muted { color: var(--muted); font-size: 0.9rem; }

.breakdown {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}

th { color: var(--muted); font-weight: 600; }

.party-first { color: var(--first-party); font-weight: 600; }
.party-third { color: var(--third-party); font-weight: 600; }

.cookie-flags {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: normal;
  min-width: 220px;
  max-width: 320px;
}

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a { color: inherit; }
.site-footer p { margin: 0 0 10px; }

@media (min-width: 560px) {
  .input-row { flex-direction: row; }
  #url-input { flex: 1; }
  #check-button { flex-shrink: 0; }
  .report-summary { flex-direction: row; align-items: center; }
}

@media (min-width: 720px) {
  .wrap { padding-top: 48px; }
  .wordmark { font-size: 2.3rem; }
}
