:root {
  color-scheme: light;
  --ink: #1e1712;
  --muted: #6d6158;
  --paper: #f6efe4;
  --panel: #fffaf2;
  --line: #ded1c1;
  --orange: #e4572e;
  --green: #1f8a70;
  --yellow: #ad7b12;
  --red: #bb3e2f;
  --shadow: 0 22px 60px rgba(69, 43, 24, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(228, 87, 46, 0.16), transparent 36%),
    radial-gradient(circle at 80% 10%, rgba(31, 138, 112, 0.16), transparent 28%),
    var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
}

.intro {
  max-width: 820px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 8vw, 88px);
  line-height: 0.9;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.panel,
.score-card,
.finding {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.audit-form {
  display: grid;
  grid-template-columns: 0.85fr 1.45fr 1.05fr auto;
  gap: 14px;
  align-items: end;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.18);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fffaf2;
  padding: 0 20px;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.status {
  min-height: 24px;
  margin-top: 16px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.debug-panel,
.debug-summary {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

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

.debug-header .eyebrow {
  margin: 0;
}

.debug-header span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.debug-log {
  display: grid;
  max-height: 260px;
  margin: 12px 0 0;
  padding: 0;
  gap: 8px;
  overflow: auto;
  list-style: none;
}

.debug-log li {
  display: grid;
  grid-template-columns: 54px 110px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  padding: 9px 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

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

.debug-log em {
  font-style: normal;
}

.debug-log pre {
  grid-column: 1 / -1;
  margin: 0;
  white-space: pre-wrap;
}

.report {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  margin-top: 22px;
}

.score-card {
  min-height: 180px;
  padding: 22px;
}

.score-card strong {
  display: block;
  font-size: 72px;
  line-height: 1;
}

.score-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.findings {
  display: grid;
  gap: 12px;
}

.debug-summary {
  margin: 0 0 14px;
  padding-top: 0;
  border-top: 0;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.debug-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 250, 242, 0.82);
  padding: 11px;
}

.debug-card span,
.debug-card small,
summary {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.debug-card strong {
  display: block;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.debug-card small {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

summary {
  cursor: pointer;
}

.raw-debug {
  max-height: 360px;
  margin: 10px 0 0;
  overflow: auto;
}

.finding {
  padding: 16px;
}

.finding header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.finding h2 {
  margin: 0;
  font-size: 19px;
}

.badge {
  border-radius: 999px;
  padding: 5px 10px;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.good {
  background: var(--green);
}

.warn {
  background: var(--yellow);
}

.bad {
  background: var(--red);
}

.finding p {
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.45;
}

.impact {
  border-left: 3px solid var(--orange);
  margin-bottom: 12px;
  padding-left: 10px;
}

.impact p {
  margin-bottom: 6px;
}

.evidence {
  margin: 0 0 10px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.tech {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 880px) {
  .audit-form,
  .report,
  .debug-grid,
  .debug-log li {
    grid-template-columns: 1fr;
  }

  .shell {
    padding: 32px 0;
  }
}
