:root {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --text: #1c1c28;
  --muted: #63637a;
  --border: #e2e2ec;
  --accent: #ff8c1a; /* scratch-ish orange */
  --accent-dark: #e5760a;
  --ok: #2e9e5b;
  --warn: #d99a10;
  --bad: #d94e4e;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.page-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 20px;
  text-align: center;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.tagline {
  color: var(--muted);
  margin: 0;
}

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

.analyze-form {
  display: flex;
  gap: 8px;
  margin: 24px 0;
}

#project-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

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

#analyze-button {
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

#analyze-button:hover {
  background: var(--accent-dark);
}

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

.status {
  min-height: 1.4em;
  margin-bottom: 16px;
  color: var(--muted);
}

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

.report {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-summary {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.project-summary img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg);
}

.project-summary h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.project-summary .meta-line {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 8px;
}

.project-summary .links a {
  color: var(--accent-dark);
  text-decoration: none;
  margin-right: 12px;
  font-size: 0.9rem;
}

.project-summary .links a:hover {
  text-decoration: underline;
}

details.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

details.section > summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.section > summary::-webkit-details-marker {
  display: none;
}

details.section > summary::after {
  content: "▸";
  color: var(--muted);
  transition: transform 0.15s ease;
}

details.section[open] > summary::after {
  transform: rotate(90deg);
}

.section-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.section-intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 12px 0;
}

.finding {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.finding:last-child {
  border-bottom: none;
}

.finding-title {
  font-weight: 600;
  margin: 0 0 4px;
}

.finding-detail {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-right: 8px;
}

.badge.ok {
  background: color-mix(in srgb, var(--ok) 15%, transparent);
  color: var(--ok);
}

.badge.warn {
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  color: var(--warn);
}

.badge.bad {
  background: color-mix(in srgb, var(--bad) 15%, transparent);
  color: var(--bad);
}

.deep-scan-button {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.deep-scan-button:hover {
  border-color: var(--accent);
}

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

.no-findings {
  color: var(--ok);
  font-weight: 600;
  padding: 12px 0;
}

.page-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .analyze-form {
    flex-direction: column;
  }

  .project-summary {
    flex-direction: column;
    align-items: flex-start;
  }
}
