.topbar {
  padding: 26px;
}

.topbar h1 {
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.topbar > p:last-child,
.result-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.topbar-spacer {
  min-height: 34px;
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.upload-panel {
  margin-top: 18px;
  padding: 24px;
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
}

.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.file-drop:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.05);
  transform: translateY(-1px);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.file-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.file-copy strong {
  font-size: 15px;
}

.file-copy span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.compare-button {
  min-width: 128px;
  padding: 0 20px;
}

.hidden {
  display: none;
}

.result-shell {
  margin-top: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 14px;
  font-size: 30px;
  line-height: 1;
}

.warehouse-card {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.warehouse-card strong {
  color: #1d4ed8;
}

.store-card {
  border-color: #fed7aa;
  background: #fff7ed;
}

.store-card strong {
  color: #c2410c;
}

.muted-card {
  background: var(--surface-soft);
}

.result-panel {
  overflow: hidden;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.result-head h2 {
  margin-top: 5px;
  font-size: 22px;
}

.result-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 20px 24px 24px;
}

.result-block {
  min-width: 0;
}

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

.block-head h3 {
  font-size: 17px;
}

.table-wrap {
  max-height: 500px;
}

table {
  min-width: 590px;
}

th,
td {
  padding: 10px 12px;
  text-align: center;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  font-size: 13px;
}

.empty-row td {
  padding: 32px 12px;
  color: var(--muted);
}

.result-block .pagination {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .upload-grid,
  .result-sections {
    grid-template-columns: 1fr;
  }

  .compare-button {
    min-height: 48px;
  }

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

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    margin: 12px auto 24px;
  }

  .topbar,
  .upload-panel,
  .result-head,
  .result-sections {
    padding: 14px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-card {
    min-height: 96px;
    padding: 14px;
  }

  .summary-card strong {
    font-size: 24px;
  }

  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .result-head button {
    width: 100%;
  }
}
