:root {
  color-scheme: light;
  --scan-ink: #101418;
  --scan-soft: #4d5863;
  --scan-muted: #7a858f;
  --scan-grid: rgba(16, 20, 24, 0.045);
  --scan-paper: #f7f5ef;
  --scan-panel: #fffefa;
  --scan-inset: #f1f4f4;
  --scan-line: rgba(16, 20, 24, 0.14);
  --scan-line-strong: rgba(16, 20, 24, 0.24);
  --scan-teal: #0f766e;
  --scan-teal-dark: #0b4f4a;
  --scan-teal-soft: #d8f3ef;
  --scan-red: #b42318;
  --scan-red-soft: #fde4df;
  --scan-shadow: 0 20px 55px rgba(16, 20, 24, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, var(--scan-grid) 1px, transparent 1px),
    linear-gradient(var(--scan-grid) 1px, transparent 1px),
    var(--scan-paper);
  background-size: 36px 36px;
  color: var(--scan-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.intro {
  max-width: 760px;
  margin-bottom: 24px;
}

.eyebrow,
.tag,
.file-rule,
.verdict-label {
  margin: 0;
  color: var(--scan-teal-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 10px;
  max-width: 760px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 680;
  line-height: 0.92;
}

h2 {
  margin-top: 6px;
  font-size: 1.45rem;
  font-weight: 750;
}

.summary {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--scan-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

.status,
.notice {
  border-left: 4px solid var(--scan-teal);
  background: rgba(255, 254, 250, 0.82);
  padding: 14px 16px;
  color: var(--scan-soft);
  font-size: 0.94rem;
}

.status.error {
  border-left-color: var(--scan-red);
}

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

.grid.single {
  grid-template-columns: minmax(0, 760px);
}

.panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  border: 1px solid var(--scan-line);
  border-radius: 8px;
  background: var(--scan-panel);
  padding: 22px;
  box-shadow: var(--scan-shadow);
}

.panel-head,
.result-topline,
.meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.file-rule {
  color: var(--scan-muted);
  white-space: nowrap;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 2px dashed var(--scan-line-strong);
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 118, 110, 0.045), rgba(15, 118, 110, 0.02)),
    var(--scan-inset);
  cursor: pointer;
  padding: 24px;
  text-align: center;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--scan-teal);
  background: var(--scan-teal-soft);
  transform: translateY(-1px);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(15, 118, 110, 0.42);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--scan-teal);
  color: white;
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1;
}

.drop-title {
  margin-top: 12px;
  color: var(--scan-ink);
  font-size: 1.05rem;
  font-weight: 760;
}

.drop-subtitle {
  max-width: 100%;
  margin-top: 6px;
  overflow: hidden;
  color: var(--scan-muted);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-wrap {
  border: 1px solid var(--scan-line);
  border-radius: 8px;
  background: #101418;
  padding: 10px;
}

.preview-wrap.is-hidden {
  display: none;
}

.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 6px;
}

button {
  width: fit-content;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--scan-teal);
  color: white;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 0 20px;
  transition:
    background-color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: var(--scan-teal-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.result-card {
  border: 1px solid var(--scan-line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 18px;
}

.result-card.is-empty .result-content {
  display: none;
}

.result-card:not(.is-empty) .result-empty {
  display: none;
}

.result-empty {
  color: var(--scan-muted);
}

.verdict-pill {
  border-radius: 999px;
  background: #e6eceb;
  color: var(--scan-soft);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 10px;
}

.is-malignant .verdict-pill {
  background: var(--scan-red-soft);
  color: var(--scan-red);
}

.is-non-malignant .verdict-pill {
  background: var(--scan-teal-soft);
  color: var(--scan-teal-dark);
}

.is-error .verdict-pill {
  background: var(--scan-red-soft);
  color: var(--scan-red);
}

.verdict {
  margin-top: 12px;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 820;
  line-height: 1;
}

.verdict-copy {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--scan-soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

.meter-group {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.meter-row {
  display: grid;
  gap: 8px;
}

.meter-label {
  color: var(--scan-soft);
  font-size: 0.94rem;
}

.meter-label strong {
  color: var(--scan-ink);
  font-variant-numeric: tabular-nums;
}

.meter-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e9ec;
}

.meter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 360ms ease;
}

.meter-fill.danger {
  background: var(--scan-red);
}

.meter-fill.calm {
  background: var(--scan-teal);
}

.raw-details {
  margin-top: 18px;
}

.raw-details summary {
  width: fit-content;
  color: var(--scan-teal-dark);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
}

.result {
  min-height: 120px;
  overflow: auto;
  margin: 12px 0 0;
  border-radius: 8px;
  background: #111820;
  color: #d8fff6;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.notice {
  margin-top: 18px;
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 980px);
    padding-top: 32px;
  }

  .grid,
  .grid.single {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .panel-head,
  .result-topline,
  .meter-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .file-rule {
    white-space: normal;
  }

  button {
    width: 100%;
  }
}
