:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f2ef;
  color: #171814;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

main {
  width: min(100%, 620px);
  padding: clamp(28px, 7vw, 56px);
  border: 1px solid #d7d8d1;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 70px rgb(29 34 20 / 9%);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 56px);
  line-height: .98;
  letter-spacing: -.045em;
}

.lead {
  margin: 24px 0;
  color: #51544b;
  font-size: 18px;
  line-height: 1.55;
}

.notice {
  margin-bottom: 28px;
  padding-left: 15px;
  border-left: 3px solid #a8b67a;
  color: #686b61;
  font-size: 14px;
  line-height: 1.5;
}

button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 16px 20px;
  background: #252c18;
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

button:hover { background: #374022; }
button:disabled { cursor: wait; opacity: .7; }

#progress {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

#progress[hidden] { display: none; }

#progress p { margin: 4px 0 0; color: #73766e; }

.spinner {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 3px solid #dfe2d5;
  border-top-color: #59683a;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.session, .error {
  margin: 22px 0 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.error { color: #a12929; }

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}

body.reports-page {
  display: block;
  background: #f2f2ef;
}

.reports-page main {
  width: min(1180px, 100%);
  margin: 0 auto;
  box-shadow: none;
}

.reports-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.reports-header h1 { font-size: clamp(34px, 5vw, 54px); }
.reports-header .lead { margin-bottom: 0; }
.reports-header button { width: auto; white-space: nowrap; }

.report-list {
  display: grid;
  gap: 14px;
}

.report-card {
  border: 1px solid #dfe0da;
  border-radius: 16px;
  padding: 20px;
  background: #fafaf8;
}

.assessment {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid #dfe0da;
  border-radius: 12px;
  background: #f5f7f0;
}

.assessment.ok { border-color: #bbd6b7; background: #f1f8ef; }
.assessment.warning { border-color: #e5c783; background: #fff8e7; }
.assessment.critical { border-color: #e3b3b3; background: #fff0f0; }

.assessment h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.assessment p { margin: 7px 0 12px; line-height: 1.45; }

.assessment ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assessment li {
  display: grid;
  gap: 2px;
  padding-left: 12px;
  border-left: 3px solid #b6b9ae;
  color: #4e5149;
  font-size: 14px;
  line-height: 1.4;
}

.assessment li.ok { border-color: #6b9a65; }
.assessment li.warning { border-color: #d09521; }
.assessment li.critical { border-color: #c85353; }

.report-summary {
  display: grid;
  grid-template-columns: minmax(210px, 1.2fr) repeat(3, minmax(130px, 1fr));
  gap: 18px;
  align-items: start;
}

.report-label {
  display: block;
  margin-bottom: 5px;
  color: #7a7d73;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.report-value {
  display: block;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.probe-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.probe {
  padding: 6px 9px;
  border-radius: 999px;
  background: #e7eee0;
  color: #2c532a;
  font-size: 12px;
}

.probe.failed { background: #f7dddd; color: #842d2d; }

details { margin-top: 16px; }
summary { cursor: pointer; color: #4f5e31; font-weight: 700; }

.report-json {
  max-height: 440px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 16px;
  border-radius: 10px;
  background: #1d2118;
  color: #eaf0df;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.empty-state {
  padding: 44px 20px;
  border: 1px dashed #cfd1c8;
  border-radius: 16px;
  color: #74776f;
  text-align: center;
}

@media (max-width: 780px) {
  .reports-header { align-items: stretch; flex-direction: column; }
  .reports-header button { width: 100%; }
  .report-summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .report-summary { grid-template-columns: 1fr; }
}
