:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #64716e;
  --line: #d8dfdc;
  --panel: #ffffff;
  --paper: #f5f7f4;
  --teal: #0d8f7d;
  --teal-dark: #086b5d;
  --cobalt: #2457d6;
  --amber: #c78312;
  --rose: #c84661;
  --green: #16845e;
  --charcoal: #23302d;
  --shadow: 0 18px 45px rgba(20, 34, 30, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.lang-button {
  min-width: 40px;
  min-height: 32px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.lang-button.is-active {
  background: var(--charcoal);
  color: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 4.7rem);
  line-height: 0.92;
  max-width: 840px;
}

.status-pill {
  min-width: 92px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--charcoal);
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
}

.scanner-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.68fr);
  gap: 28px;
  align-items: end;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13, 143, 125, 0.11), rgba(36, 87, 214, 0.08)),
    var(--panel);
  box-shadow: var(--shadow);
}

.scanner-copy h2 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.scanner-copy p,
.section-heading p,
.empty-panel p,
.score-copy p,
.check-summary {
  color: var(--muted);
  line-height: 1.55;
}

.scan-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--charcoal);
  font-weight: 750;
}

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

.input-row input {
  min-width: 0;
  width: 100%;
  height: 52px;
  border: 1px solid #b9c5c1;
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.input-row input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(13, 143, 125, 0.14);
}

.input-row button,
.download-actions button,
.file-card button {
  min-height: 44px;
  border-radius: 8px;
  background: var(--charcoal);
  color: white;
  font-weight: 800;
  white-space: nowrap;
}

.input-row button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
}

.button-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--teal);
}

.summary-grid,
.score-band,
.protocol-strip,
.checks-section,
.fixpack-section,
.discovery-section {
  margin-top: 24px;
}

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

.empty-panel {
  min-height: 220px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.empty-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #e7f2ef;
  color: var(--teal-dark);
  font-weight: 850;
}

.empty-panel h2 {
  font-size: 1.35rem;
}

.results[hidden] {
  display: none;
}

.score-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
  border-radius: 8px;
  background: var(--charcoal);
  color: white;
}

.score-ring {
  --score: 0deg;
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--charcoal) 58%, transparent 60%),
    conic-gradient(var(--teal) var(--score), rgba(255, 255, 255, 0.16) 0deg);
}

.score-ring span {
  font-size: 2.35rem;
  font-weight: 900;
}

.score-ring small {
  margin-top: -26px;
  color: rgba(255, 255, 255, 0.68);
}

.score-copy h2 {
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 4vw, 2.55rem);
}

.score-copy p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
}

.score-copy .eyebrow {
  color: #87e0d2;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.download-actions button {
  padding: 0 14px;
  background: white;
  color: var(--charcoal);
}

.protocol-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.protocol-chip {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.protocol-chip strong,
.protocol-chip span {
  display: block;
}

.protocol-chip strong {
  margin-bottom: 7px;
}

.protocol-chip span {
  color: var(--muted);
  font-size: 0.86rem;
}

.protocol-chip.pass {
  border-color: rgba(22, 132, 94, 0.38);
  background: #eef8f3;
}

.protocol-chip.warn {
  border-color: rgba(199, 131, 18, 0.38);
  background: #fff8eb;
}

.protocol-chip.fail {
  border-color: rgba(200, 70, 97, 0.38);
  background: #fff0f3;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.section-heading p {
  max-width: 560px;
  margin-bottom: 0;
  text-align: right;
}

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

.check-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.check-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.check-card h3 {
  margin-bottom: 6px;
  font-size: 1.18rem;
}

.check-status {
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.check-card.pass .check-status {
  color: var(--green);
}

.check-card.warn .check-status {
  color: var(--amber);
}

.check-card.fail .check-status {
  color: var(--rose);
}

.mini-score {
  min-width: 68px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eef2f0;
  color: var(--charcoal);
  font-weight: 850;
  text-align: center;
}

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

.detail-columns h4 {
  margin-bottom: 8px;
  color: var(--charcoal);
  font-size: 0.9rem;
}

.detail-columns ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.detail-columns li + li {
  margin-top: 6px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.file-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.file-path {
  margin-bottom: 8px;
  color: var(--cobalt);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.file-card button {
  padding: 0 12px;
  background: #e9f1ef;
  color: var(--teal-dark);
}

.endpoint-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.endpoint-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.endpoint-table th,
.endpoint-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.endpoint-table th {
  color: var(--charcoal);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.endpoint-table tr:last-child td {
  border-bottom: 0;
}

.endpoint-ok {
  color: var(--green);
  font-weight: 800;
}

.endpoint-miss {
  color: var(--rose);
  font-weight: 800;
}

.loading {
  pointer-events: none;
  opacity: 0.68;
}

@media (max-width: 940px) {
  .scanner-panel,
  .score-band,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .protocol-strip,
  .file-grid,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-actions {
    justify-content: flex-start;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 8px;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .topbar,
  .topbar-actions,
  .input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .language-toggle {
    width: 100%;
  }

  .scanner-panel,
  .score-band,
  .check-card,
  .empty-panel {
    padding: 18px;
  }

  .protocol-strip,
  .file-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 110px;
    height: 110px;
  }

  .file-card {
    align-items: stretch;
    flex-direction: column;
  }
}
