:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #020617;
  --muted: #475569;
  --secondary: #334155;
  --primary: #0F172A;
  --accent: #0369A1;
  --accent-dark: #075985;
  --accent-soft: #E0F2FE;
  --accent-wash: #F0F9FF;
  --line: #E2E8F0;
  --line-strong: #94A3B8;
  --danger: #991B1B;
  --danger-bg: #FEF2F2;
  --danger-line: #FECACA;
  --topbar-muted: #CBD5E1;
  --chip: #F8FAFC;
  --radius: 12px;
  --max: 960px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  background: var(--primary);
  color: #F8FAFC;
}

.topbar-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand,
.product {
  margin: 0;
}

.brand {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.product {
  color: var(--topbar-muted);
  font-size: 0.875rem;
}

.main {
  padding: 2rem 0 3rem;
}

h1 {
  margin: 0;
  color: var(--primary);
  font-family: var(--mono);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.lede {
  max-width: 38rem;
  margin: 0.75rem 0 0;
  color: var(--secondary);
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 11.5rem;
  margin-top: 1.5rem;
  padding: 1.5rem 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms, background-color 200ms;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.dropzone:has(.file-input:focus-visible) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.35);
}

.dropzone.is-busy {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-wash);
  pointer-events: none;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-input:focus {
  outline: none;
}

.dropzone-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.dropzone-mark svg {
  width: 1.5rem;
  height: 1.5rem;
}

.dropzone-title {
  font-weight: 600;
  color: var(--primary);
}

.dropzone-hint {
  color: var(--muted);
  font-size: 0.875rem;
}

.submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms;
}

.submit:hover {
  background: var(--accent-dark);
}

.submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.js .submit {
  display: none;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--danger-line);
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  text-align: left;
}

.alert svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
}

.alert p {
  margin: 0;
}

.result {
  margin-top: 1.5rem;
}

.license {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.license-head,
.bundle {
  padding: 1.15rem 1.25rem 1.2rem;
}

.bundle {
  border-top: 1px solid var(--line);
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.license-head h2,
.bundle h3 {
  margin: 0.25rem 0 0;
  color: var(--primary);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.license-head h2 {
  font-family: var(--mono);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.license-sub {
  margin: 0.35rem 0 0;
  color: var(--secondary);
}

.bundle h3 {
  font-size: 1rem;
}

.spec {
  margin: 0;
  border-top: 1px solid var(--line);
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.spec-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--line);
}

.spec-grid .spec-item:nth-child(-n + 2) {
  border-top: 0;
}

.spec-grid .spec-item:nth-child(odd):not(:last-child) {
  box-shadow: inset -1px 0 0 var(--line);
}

.spec-item dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.spec-item dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.spec-item.is-wide {
  align-items: start;
}

.spec-item dd.mono {
  font-family: var(--mono);
  font-size: 0.875rem;
}

.spec-item dd.scroll {
  max-height: 7.5rem;
  padding: 0.55rem 0.7rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chip);
  line-height: 1.45;
}

.spec-item dd.pre {
  white-space: pre-wrap;
}

.block-label {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.name-list,
.pairs {
  margin: 0.5rem 0 0;
}

.name-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.name-list li,
.pairs div {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--chip);
}

.name-list li {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.pairs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.pairs dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.pairs dd {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: 1rem;
  }

  .main {
    padding: 1.5rem 0 2.5rem;
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }

  .spec-grid,
  .name-list {
    grid-template-columns: 1fr;
  }

  .spec-grid .spec-item:nth-child(odd) {
    box-shadow: none;
  }

  .spec-grid .spec-item:nth-child(n + 2) {
    border-top: 1px solid var(--line);
  }

  .spec-item {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dropzone,
  .submit {
    transition: none;
  }
}
