:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #18202f;
  --muted: #667085;
  --line: #d8dee9;
  --accent: #176b87;
  --accent-2: #9a5b13;
  --good: #1f7a4d;
  --warn: #b25d00;
  --bad: #b42318;
  --shadow: 0 16px 40px rgba(24, 32, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  filter: brightness(0.94);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button.secondary {
  color: var(--accent);
  background: #e7f4f7;
}

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

.workspace {
  display: grid;
  gap: 22px;
}

.intro {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.55;
}

.analyze-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) minmax(200px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(23, 107, 135, 0.18);
  border-color: var(--accent);
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
}

.status.error {
  color: var(--bad);
}

.panel {
  display: grid;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hidden {
  display: none;
}

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

.score-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score,
.grade {
  display: inline-grid;
  place-items: center;
  min-width: 62px;
  min-height: 48px;
  border-radius: 6px;
  font-size: 1.6rem;
  font-weight: 900;
}

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

.grade {
  color: var(--accent-2);
  background: #fff3df;
}

.summary-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-grid > div,
.detail-grid > section,
.brief-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcff;
}

.summary-grid p,
.paywall p {
  color: var(--muted);
  line-height: 1.5;
}

.teaser-list,
.queries-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.teaser-list li {
  filter: blur(2.5px);
  user-select: none;
}

.paywall {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #f0cf99;
  border-radius: 8px;
  padding: 18px;
  background: #fff8ed;
}

.ratings-list,
.recommendations-list {
  display: grid;
  gap: 12px;
}

.rating-row {
  display: grid;
  grid-template-columns: 180px 1fr 64px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.rating-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.rating-copy p,
.recommendation p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.recommendation {
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

.priority {
  display: inline-block;
  margin-bottom: 6px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #fff;
  background: var(--accent-2);
  font-size: 0.77rem;
  font-weight: 800;
}

pre {
  max-height: 280px;
  overflow: auto;
  margin: 0;
  border-radius: 6px;
  padding: 14px;
  color: #101828;
  background: #eef2f6;
  white-space: pre-wrap;
}

.alert { border-left: 3px solid #d64545; background: rgba(214, 69, 69, 0.08); padding: 0.6rem 0.9rem; margin: 0.5rem 0; border-radius: 4px; }
.alert.ok { border-left-color: #3f9d63; background: rgba(63, 157, 99, 0.08); }
.checks { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.85rem; }
.checks .pass { color: #3f9d63; }
.checks .fail { color: #b54708; }
.evidence { font-size: 0.82rem; opacity: 0.75; font-style: italic; }

.spinner {
  width: 34px;
  height: 34px;
  margin: 6px 0 2px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

@media (max-width: 820px) {
  .analyze-form,
  .summary-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .paywall {
    align-items: stretch;
    flex-direction: column;
  }

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